|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.Resource
org.apache.tools.ant.types.resources.URLResource
public class URLResource
Exposes a URL as a Resource.
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.types.Resource |
|---|
MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE |
| Fields inherited from class org.apache.tools.ant.types.DataType |
|---|
checked, ref |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
URLResource()
Default constructor. |
|
URLResource(java.io.File f)
Convenience constructor. |
|
URLResource(java.lang.String u)
String constructor for Ant attribute introspection. |
|
URLResource(java.net.URL u)
Convenience constructor. |
|
URLResource(URLProvider u)
Convenience constructor. |
|
| Method Summary | |
|---|---|
protected void |
connect()
Ensure that we have a connection. |
protected void |
connect(int logLevel)
Ensure that we have a connection. |
boolean |
equals(java.lang.Object another)
Test whether an Object equals this URLResource. |
java.io.InputStream |
getInputStream()
Get an InputStream for the Resource. |
long |
getLastModified()
Tells the modification time in milliseconds since 01.01.1970 . |
java.lang.String |
getName()
Get the name of this URLResource (its file component minus the leading separator). |
java.io.OutputStream |
getOutputStream()
Get an OutputStream for the Resource. |
long |
getSize()
Get the size of this Resource. |
java.net.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 |
setBaseURL(java.net.URL base)
Base URL which combined with the relativePath attribute defines the URL. |
void |
setFile(java.io.File f)
Set the URL from a File. |
void |
setRefid(Reference r)
Overrides the super version. |
void |
setRelativePath(java.lang.String r)
Relative path which combined with the baseURL attribute defines the URL. |
void |
setURL(java.net.URL u)
Set the URL for this URLResource. |
java.lang.String |
toString()
Return this URLResource formatted as a String. |
| Methods inherited from class org.apache.tools.ant.types.Resource |
|---|
as, clone, compareTo, getMagicNumber, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setName, setSize, size, toLongString |
| Methods inherited from class org.apache.tools.ant.types.DataType |
|---|
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public URLResource()
public URLResource(java.net.URL u)
u - the URL to expose.public URLResource(URLProvider u)
u - holds the URL to expose.public URLResource(java.io.File f)
f - the File to set as a URL.public URLResource(java.lang.String u)
u - String representation of this URL.IntrospectionHelper| Method Detail |
|---|
public void setURL(java.net.URL u)
u - the URL to expose.public void setFile(java.io.File f)
f - the File to set as a URL.public void setBaseURL(java.net.URL base)
public void setRelativePath(java.lang.String r)
public java.net.URL getURL()
getURL in interface URLProviderpublic void setRefid(Reference r)
setRefid in class Resourcer - the Reference to set.public java.lang.String getName()
getName in class Resourcepublic java.lang.String toString()
toString in class Resourcepublic boolean isExists()
isExists in class Resourcepublic long getLastModified()
getLastModified in class ResourceFile.public boolean isDirectory()
isDirectory in class Resourcepublic long getSize()
getSize in class Resourcepublic boolean equals(java.lang.Object another)
equals in class Resourceanother - the other Object to compare.
public int hashCode()
hashCode in class Resource
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class Resourcejava.io.IOException - if unable to provide the content of this
Resource as a stream.
java.lang.UnsupportedOperationException - if InputStreams are not
supported for this Resource type.
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class Resourcejava.io.IOException - if unable to provide the content of this
Resource as a stream.
java.lang.UnsupportedOperationException - if OutputStreams are not
supported for this Resource type.
java.io.IOException - if the URL cannot be opened.
protected void connect()
throws java.io.IOException
java.io.IOException - if the connection cannot be established.
protected void connect(int logLevel)
throws java.io.IOException
logLevel - severity to use when logging connection errors.
Should be one of the MSG_ constants in Project.
java.io.IOException - if the connection cannot be established.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||