public abstract class AbstractResource extends Object implements Resource
Resource
Constructor and Description |
---|
AbstractResource() |
Modifier and Type | Method and Description |
---|---|
void |
append(Action<OutputStream> appendCallback)
Opens up an
InputStream to append (write at the end of the
existing stream) to 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. |
<E> E |
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
append, getLastModified, getName, getQualifiedPath, getSize, isExists, isReadOnly, read, write
public final void read(Action<InputStream> readCallback)
Resource
InputStream
to read from the resource, and allows a
callback to perform writing actions on it.public final <E> E read(Func<InputStream,E> readCallback)
Resource
InputStream
to read from the resource, and allows a
callback function to perform writing actions on it and return the
function's result.public final void write(Action<OutputStream> writeCallback) throws ResourceException
Resource
OutputStream
to write to the resource, and allows a
callback to perform writing actions on it.write
in interface Resource
writeCallback
- a callback which should define what to write to the resource.ResourceException
- if an error occurs while writingpublic final void append(Action<OutputStream> appendCallback) throws ResourceException
Resource
InputStream
to append (write at the end of the
existing stream) to the resource.append
in interface Resource
appendCallback
- a callback which should define what to append to the resource.ResourceException
- if an error occurs while appendingCopyright © 2007–2015 The Apache Software Foundation. All rights reserved.