public abstract class AbstractDataResource extends Object implements DataResource
DataResource
interface.Constructor and Description |
---|
AbstractDataResource()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getName()
This method gets the name of the resource.
|
String |
getPath()
This method gets the path of this resource.
|
abstract String |
getSchemePrefix()
This method gets the scheme-prefix of absolute
URIs for this type of
DataResource . |
long |
getSize()
This method gets the size (content-length) of this resource.
|
String |
getUri()
This method gets a string identifying this
DataResource . |
int |
hashCode() |
boolean |
isAvailable()
This method determines if this resource is available.
|
Boolean |
isModifiedSince(Date date)
This method determines if this resource has been been modified since the given
data . |
OutputStream |
openOutputStream()
This method opens an output-stream in order to write data to the resource.
|
InputStream |
openStream()
This method opens this resource for reading.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLastModificationDate, getUrl, isData, navigate
public abstract String getSchemePrefix()
URIs
for this type of
DataResource
. The scheme-prefix has the following form: <scheme>
:<suffix>
where <suffix>
is the empty string or something like //
.public long getSize() throws ResourceNotAvailableException
getSize
in interface DataResource
ResourceNotAvailableException
- if this resource is NOT available
.public InputStream openStream()
openStream
in interface DataResource
URL.openStream()
public String getPath()
DataResource
name
of
the resource. getPath
in interface DataResource
public String getUri()
DataResource
DataResource
. In most cases this will be the same as
string-representation
of the URL
. However this method will not throw an
exception.getUri
in interface DataResource
public boolean isAvailable()
DataResource
data can be read
. DataResource.isData()
to prevent such expensive operaitons.isAvailable
in interface DataResource
true
if this resource is available, false
otherwise.public Boolean isModifiedSince(Date date)
DataResource
data
.isModifiedSince
in interface DataResource
date
- is the Date
to check for.true
if the resource has been modified after the given date
, false
if it has NOT
been modified after the given date
and null
if this can NOT be determined (resource not
available
or operation NOT supported by this resource).public OutputStream openOutputStream() throws ResourceNotAvailableException, ResourceNotWritableException, RuntimeIoException
DataResource
openOutputStream
in interface DataResource
OutputStream
to write to the resource.ResourceNotAvailableException
- if this resource is NOT available
.ResourceNotWritableException
- if the resource is NOT writable (e.g. read-only).RuntimeIoException
- if an input/output error occurred.public String getName()
DataResource
filename
.getName
in interface DataResource
Copyright © 2001–2016 mmm-Team. All rights reserved.