org.apache.tools.ant.types.resources
Class URLResource
- Cloneable, Comparable, ResourceCollection
Exposes a URL as a Resource.
protected void | connect() - Ensure that we have a connection.
|
boolean | equals(Object another) - Test whether an Object equals this URLResource.
|
InputStream | getInputStream() - Get an InputStream for the Resource.
|
long | getLastModified() - Tells the modification time in milliseconds since 01.01.1970 .
|
String | getName() - Get the name of this URLResource
(its file component minus the leading separator).
|
OutputStream | getOutputStream() - Get an OutputStream for the Resource.
|
long | getSize() - Get the size of this Resource.
|
URL | getURL() - Get the URL used by this URLResource.
|
int | hashCode() - Get the hash code for this Resource.
|
boolean | isDirectory() - Tells if the resource is a directory.
|
boolean | isExists() - Find out whether the URL exists .
|
void | setFile(File f) - Set the URL from a File.
|
void | setRefid(Reference r) - Overrides the super version.
|
void | setURL(URL u) - Set the URL for this URLResource.
|
String | toString() - Return this URLResource formatted as a String.
|
clone , compareTo , equals , getInputStream , getLastModified , getMagicNumber , getName , getOutputStream , getSize , hashCode , isDirectory , isExists , isFilesystemOnly , iterator , setDirectory , setExists , setLastModified , setName , setRefid , setSize , size , toLongString , toString |
checkAttributesAllowed , checkChildrenAllowed , circularReference , clone , dieOnCircularReference , dieOnCircularReference , dieOnCircularReference , getCheckedRef , getCheckedRef , getCheckedRef , getCheckedRef , getDataTypeName , getRefid , invokeCircularReferenceCheck , isChecked , isReference , noChildrenAllowed , setChecked , setRefid , toString , tooManyAttributes |
URLResource
public URLResource()
Default constructor.
URLResource
public URLResource(File f)
Convenience constructor.
f
- the File to set as a URL.
URLResource
public URLResource(String u)
String constructor for Ant attribute introspection.
u
- String representation of this URL.
URLResource
public URLResource(URL u)
Convenience constructor.
connect
protected void connect()
throws IOException
Ensure that we have a connection.
equals
public boolean equals(Object another)
Test whether an Object equals this URLResource.
- equals in interface Resource
another
- the other Object to compare.
- true if the specified Object is equal to this Resource.
getInputStream
public InputStream getInputStream()
throws IOException
Get an InputStream for the Resource.
- getInputStream in interface Resource
- an InputStream containing this Resource's content.
getLastModified
public long getLastModified()
Tells the modification time in milliseconds since 01.01.1970 .
- getLastModified in interface Resource
- 0 if the resource does not exist to mirror the behavior
of
File
.
getName
public String getName()
Get the name of this URLResource
(its file component minus the leading separator).
- getName in interface Resource
- the name of this resource.
getOutputStream
public OutputStream getOutputStream()
throws IOException
Get an OutputStream for the Resource.
- getOutputStream in interface Resource
- an OutputStream to which content can be written.
getSize
public long getSize()
Get the size of this Resource.
- getSize in interface Resource
- the size, as a long, 0 if the Resource does not exist (for
compatibility with java.io.File), or UNKNOWN_SIZE if not known.
getURL
public URL getURL()
Get the URL used by this URLResource.
hashCode
public int hashCode()
Get the hash code for this Resource.
- hashCode in interface Resource
isDirectory
public boolean isDirectory()
Tells if the resource is a directory.
- isDirectory in interface Resource
- boolean whether the resource is a directory.
isExists
public boolean isExists()
Find out whether the URL exists .
- isExists in interface Resource
- true if this resource exists.
setFile
public void setFile(File f)
Set the URL from a File.
f
- the File to set as a URL.
setRefid
public void setRefid(Reference r)
Overrides the super version.
- setRefid in interface Resource
r
- the Reference to set.
setURL
public void setURL(URL u)
Set the URL for this URLResource.
toString
public String toString()
Return this URLResource formatted as a String.
- toString in interface Resource
- a String representation of this URLResource.