|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eobjects.metamodel.util.UrlResource
public class UrlResource
Resource based on URL or URI.
| Constructor Summary | |
|---|---|
UrlResource(String urlString)
|
|
UrlResource(URI uri)
|
|
UrlResource(URL url)
|
|
| Method Summary | ||
|---|---|---|
void |
append(Action<OutputStream> appendCallback)
Opens up an InputStream to append (write at the end of the
existing stream) to the resource. |
|
long |
getLastModified()
Gets the last modified timestamp value (measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)) of the resource, if available. |
|
String |
getName()
Gets the name of the resource, typically a filename or other identifying string |
|
long |
getSize()
Gets the size (in number of bytes) of this resource's data. |
|
URI |
getUri()
Gets the URI associated with this resource. |
|
boolean |
isExists()
Determines if the resource referenced by this object exists or not. |
|
boolean |
isReadOnly()
Determines if the file is read only, or if writes are also possible. |
|
InputStream |
read()
Opens up an InputStream to read from the resource. |
|
void |
read(Action<InputStream> readCallback)
Opens up an InputStream to read from the resource, and allows a
callback to perform writing actions on it. |
|
|
read(Func<InputStream,E> readCallback)
Opens up an InputStream to read from the resource, and allows a
callback function to perform writing actions on it and return the
function's result. |
|
String |
toString()
|
|
void |
write(Action<OutputStream> writeCallback)
Opens up an OutputStream to write to the resource, and allows a
callback to perform writing actions on it. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UrlResource(URL url)
public UrlResource(URI uri)
public UrlResource(String urlString)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic URI getUri()
public String getName()
Resource
getName in interface HasNamegetName in interface Resourcepublic boolean isReadOnly()
Resource
isReadOnly in interface Resource
public void write(Action<OutputStream> writeCallback)
throws ResourceException
ResourceOutputStream to write to the resource, and allows a
callback to perform writing actions on it.
write in interface ResourcewriteCallback - a callback which should define what to write to the resource.
ResourceException - if an error occurs while writing
public void append(Action<OutputStream> appendCallback)
throws ResourceException
ResourceInputStream to append (write at the end of the
existing stream) to the resource.
append in interface ResourceappendCallback - a callback which should define what to append to the resource.
ResourceException - if an error occurs while appending
public void read(Action<InputStream> readCallback)
throws ResourceException
ResourceInputStream to read from the resource, and allows a
callback to perform writing actions on it.
read in interface ResourceResourceException - if an error occurs while reading
public <E> E read(Func<InputStream,E> readCallback)
throws ResourceException
ResourceInputStream to read from the resource, and allows a
callback function to perform writing actions on it and return the
function's result.
read in interface ResourceResourceException - if an error occurs while readingpublic boolean isExists()
Resource
isExists in interface Resourcepublic long getSize()
Resource
getSize in interface Resourcepublic long getLastModified()
Resource
getLastModified in interface Resource
public InputStream read()
throws ResourceException
ResourceInputStream to read from the resource. Consumers of
this method are expected to invoke the InputStream.close() method
manually.
If possible, the other read(...) methods are preferred over this one,
since they guarantee proper closing of the resource's handles.
read in interface ResourceResourceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||