public class CommonsVFSSource extends AbstractSource implements org.apache.avalon.framework.logger.LogEnabled, ModifiableSource
| Modifier and Type | Field and Description |
|---|---|
private org.apache.commons.vfs.FileContent |
m_fileContent
The content of the resource
|
private org.apache.commons.vfs.FileObject |
m_fileObject
The resource itself
|
private java.lang.String |
m_location
Resource location
|
private org.apache.avalon.framework.logger.Logger |
m_logger
Our logging target
|
private org.apache.commons.vfs.FileSystemManager |
m_manager
FileSystemManager reference |
| Constructor and Description |
|---|
CommonsVFSSource(java.lang.String location,
java.util.Map parameters)
Constructor, creates instance of class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCancel(java.io.OutputStream stream)
Whether we can cancel writing to the output stream
|
void |
cancel(java.io.OutputStream stream)
Cancels writing to the specified output stream.
|
void |
delete()
Deletes the source.
|
void |
enableLogging(org.apache.avalon.framework.logger.Logger logger)
Enables logging for this source.
|
boolean |
exists()
Whether this resource exists or not
|
protected void |
getInfos()
Sets content information for this source.
|
java.io.InputStream |
getInputStream()
Obtain an
InputStream for this source. |
private org.apache.avalon.framework.logger.Logger |
getLogger()
Obtain access to this components logger.
|
java.io.OutputStream |
getOutputStream()
Obtain an
OutputStream to the source |
checkInfos, getContentLength, getLastModified, getMimeType, getScheme, getURI, getValidity, refresh, setContentLength, setLastModified, setScheme, setSystemIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContentLength, getLastModified, getMimeType, getScheme, getURI, getValidity, refreshprivate final java.lang.String m_location
private final org.apache.commons.vfs.FileSystemManager m_manager
FileSystemManager referenceprivate final org.apache.commons.vfs.FileObject m_fileObject
private final org.apache.commons.vfs.FileContent m_fileContent
private org.apache.avalon.framework.logger.Logger m_logger
public CommonsVFSSource(java.lang.String location,
java.util.Map parameters)
throws org.apache.commons.vfs.FileSystemException
location - location to resolveparameters - protocol specific parametersorg.apache.commons.vfs.FileSystemException - if an error occursprotected void getInfos()
getInfos in class AbstractSourceAbstractSource.getInfos()public java.io.InputStream getInputStream()
throws java.io.IOException,
SourceException
InputStream for this source.getInputStream in interface SourcegetInputStream in class AbstractSourceInputStreamjava.io.IOException - if an IO error occursSourceException - if a source exception occursSource.getInputStream()public boolean exists()
exists in interface SourceSource.exists()public boolean canCancel(java.io.OutputStream stream)
canCancel in interface ModifiableSourcestream - stream to cancelModifiableSource.canCancel(java.io.OutputStream)public void cancel(java.io.OutputStream stream)
throws java.io.IOException
cancel in interface ModifiableSourcestream - stream to cancel writing tojava.io.IOException - if an error occursModifiableSource.cancel(java.io.OutputStream)public void delete()
throws SourceException
delete in interface ModifiableSourceSourceException - if an error occursModifiableSource.delete()public java.io.OutputStream getOutputStream()
throws java.io.IOException
OutputStream to the sourcegetOutputStream in interface ModifiableSourceOutputStreamjava.io.IOExceptionModifiableSource.getOutputStream()public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging in interface org.apache.avalon.framework.logger.LogEnabledlogger - Logger instance to use#enableLogging(org.apache.avalon.framework.logger.Logger)private org.apache.avalon.framework.logger.Logger getLogger()