| Modifier and Type | Class and Description |
|---|---|
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| private URL | |
| private URLConnection | |
| private static final FileUtils | |
| private static final int | |
| private String | |
| private URL |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | URLResource(String
String representation of this URL. u)String constructor for Ant attribute introspection. |
| Modifier and Type | Method and Description |
|---|---|
| private synchronized void | close()
Closes the URL connection if: - it is opened (i.e. the field conn is not null) - this type of URLConnection supports some sort of close mechanism This method ensures the field conn will be null after the call. |
| protected void | |
| protected synchronized void | |
| public synchronized boolean | Returns: true if the specified Object is equal to this Resource.the other Object to compare. another)Overrides org. |
| public synchronized InputStream | Returns: an InputStream containing this Resource's content.Overrides org. |
| public synchronized long | Returns: 0 if the resource does not exist to mirror the behavior ofFile.Overrides org. |
| public synchronized String | Returns: the name of this resource.Overrides org. |
| public synchronized OutputStream | Returns: an OutputStream to which content can be written.Overrides org. |
| protected URLResource | getRef()
Overrides org. |
| public synchronized long | Returns: the size, as a long, 0 if the Resource does not exist (for compatibility with java.io.File), or UNKNOWN_SIZE if not known.Overrides org. |
| public synchronized URL | Returns: a URL object.Implements org. |
| public synchronized int | Returns: hash code as int.Overrides org. |
| public synchronized boolean | Returns: boolean whether the resource is a directory. |
| public synchronized boolean | Returns: true if this resource exists.Overrides org. |
| private synchronized boolean | Returns: true if this resource exists.true if the connection should be closed
after the call, false if it should stay open. closeConnection)Find out whether the URL exists, and close the connection opened to the URL if closeConnection is true. |
| private static URL | |
| public synchronized void | |
| public synchronized void | |
| public synchronized void | setRefid(Reference
the Reference to set. r)Overrides org. |
| public synchronized void | setRelativePath(String
String r)Relative path which combined with the baseURL attribute defines the URL. |
| public synchronized void | |
| public synchronized String | Returns: a String representation of this URLResource.Overrides org. |
| private long |
| baseURL | back to summary |
|---|---|
| private URL baseURL | |
| conn | back to summary |
|---|---|
| private URLConnection conn | |
| FILE_UTILS | back to summary |
|---|---|
| private static final FileUtils FILE_UTILS | |
| NULL_URL | back to summary |
|---|---|
| private static final int NULL_URL | |
| relPath | back to summary |
|---|---|
| private String relPath | |
| url | back to summary |
|---|---|
| private URL url | |
| URLResource | back to summary |
|---|---|
| public URLResource() Default constructor. | |
| URLResource | back to summary |
|---|---|
| public URLResource(URL u) Convenience constructor.
| |
| URLResource | back to summary |
|---|---|
| public URLResource(URLProvider u) Convenience constructor.
| |
| URLResource | back to summary |
|---|---|
| public URLResource(File f) Convenience constructor.
| |
| URLResource | back to summary |
|---|---|
| public URLResource(String u) String constructor for Ant attribute introspection.
| |
| close | back to summary |
|---|---|
| private synchronized void close() Closes the URL connection if: - it is opened (i.e. the field conn is not null) - this type of URLConnection supports some sort of close mechanism This method ensures the field conn will be null after the call. | |
| connect | back to summary |
|---|---|
| protected void connect() throws IOException Ensure that we have a connection.
| |
| connect | back to summary |
|---|---|
| protected synchronized void connect(int logLevel) throws IOException Ensure that we have a connection.
| |
| equals | back to summary |
|---|---|
| public synchronized boolean equals(Object another) Overrides org. Test whether an Object equals this URLResource.
| |
| getInputStream | back to summary |
|---|---|
| public synchronized InputStream getInputStream() throws IOException Overrides org. Get an InputStream for the Resource.
| |
| getLastModified | back to summary |
|---|---|
| public synchronized long getLastModified() Overrides org. Tells the modification time in milliseconds since 01.01.1970 .
| |
| getName | back to summary |
|---|---|
| public synchronized String getName() Overrides org. Get the name of this URLResource (its file component minus the leading separator).
| |
| getOutputStream | back to summary |
|---|---|
| public synchronized OutputStream getOutputStream() throws IOException Overrides org. Get an OutputStream for the Resource.
| |
| getRef | back to summary |
|---|---|
| protected URLResource getRef() Overrides org. Doc from org. Perform the check for circular references and return the referenced Resource.
| |
| getSize | back to summary |
|---|---|
| public synchronized long getSize() Overrides org. Get the size of this Resource.
| |
| getURL | back to summary |
|---|---|
| public synchronized URL getURL() Implements org. Get the URL used by this URLResource.
| |
| hashCode | back to summary |
|---|---|
| public synchronized int hashCode() Overrides org. Get the hash code for this Resource.
| |
| isDirectory | back to summary |
|---|---|
| public synchronized boolean isDirectory() Overrides org. Tells if the resource is a directory.
| |
| isExists | back to summary |
|---|---|
| public synchronized boolean isExists() Overrides org. Find out whether the URL exists .
| |
| isExists | back to summary |
|---|---|
| private synchronized boolean isExists(boolean closeConnection) Find out whether the URL exists, and close the connection opened to the URL if closeConnection is true. Note that this method does ensure that if: - the resource exists (if it returns true) - and if the current object is not a reference (isReference() returns false) - and if it was called with closeConnection to false, then the connection to the URL (stored in the conn private field) will be opened, and require to be closed by the caller.
| |
| newURL | back to summary |
|---|---|
| private static URL newURL(String u) | |
| setBaseURL | back to summary |
|---|---|
| public synchronized void setBaseURL(URL base) Base URL which combined with the relativePath attribute defines the URL.
| |
| setFile | back to summary |
|---|---|
| public synchronized void setFile(File f) Set the URL from a File.
| |
| setRefid | back to summary |
|---|---|
| public synchronized void setRefid(Reference r) Overrides org. Overrides the super version.
| |
| setRelativePath | back to summary |
|---|---|
| public synchronized void setRelativePath(String r) Relative path which combined with the baseURL attribute defines the URL.
| |
| setURL | back to summary |
|---|---|
| public synchronized void setURL(URL u) Set the URL for this URLResource.
| |
| toString | back to summary |
|---|---|
| public synchronized String toString() Overrides org. Return this URLResource formatted as a String.
| |
| withConnection | back to summary |
|---|---|
| private long withConnection(URLResource. | |
| Modifier and Type | Method and Description |
|---|---|
| public long |
| useConnection | back to summary |
|---|---|
| public long useConnection(URLConnection c) | |