|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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. |
Method Summary | |
---|---|
protected void |
connect()
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 |
setFile(java.io.File f)
Set the URL from a File. |
void |
setRefid(Reference r)
Overrides the super version. |
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 |
---|
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, 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(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 java.net.URL getURL()
public void setRefid(Reference r)
setRefid
in class Resource
r
- the Reference to set.public java.lang.String getName()
getName
in class Resource
public java.lang.String toString()
toString
in class Resource
public boolean isExists()
isExists
in class Resource
public long getLastModified()
getLastModified
in class Resource
File
.public boolean isDirectory()
isDirectory
in class Resource
public long getSize()
getSize
in class Resource
public boolean equals(java.lang.Object another)
equals
in class Resource
another
- the other Object to compare.
public int hashCode()
hashCode
in class Resource
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class Resource
java.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 Resource
java.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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |