org.apache.excalibur.source.impl
Class CommonsVFSSource

java.lang.Object
  extended byorg.apache.excalibur.source.impl.AbstractSource
      extended byorg.apache.excalibur.source.impl.CommonsVFSSource
All Implemented Interfaces:
LogEnabled, ModifiableSource, Source

public class CommonsVFSSource
extends AbstractSource
implements LogEnabled, ModifiableSource

Source implementation that provides resolver access to all protocols supported by Commons VFS.

Since:
Nov 19, 2004 10:54:02 AM
Version:
$Revision:$
Author:
Marcus Crafter

Constructor Summary
CommonsVFSSource(java.lang.String location, java.util.Map parameters)
          Constructor, creates instance of class.
 
Method Summary
 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(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.
 java.io.OutputStream getOutputStream()
          Obtain an OutputStream to the source
 
Methods inherited from class org.apache.excalibur.source.impl.AbstractSource
checkInfos, getContentLength, getLastModified, getMimeType, getScheme, getURI, getValidity, refresh, setContentLength, setLastModified, setScheme, setSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.excalibur.source.Source
getContentLength, getLastModified, getMimeType, getScheme, getURI, getValidity, refresh
 

Constructor Detail

CommonsVFSSource

public CommonsVFSSource(java.lang.String location,
                        java.util.Map parameters)
                 throws org.apache.commons.vfs.FileSystemException
Constructor, creates instance of class.

Parameters:
location - location to resolve
parameters - protocol specific parameters
Throws:
org.apache.commons.vfs.FileSystemException - if an error occurs
Method Detail

getInfos

protected void getInfos()
Sets content information for this source.

Overrides:
getInfos in class AbstractSource
See Also:
AbstractSource.getInfos()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          SourceException
Obtain an InputStream for this source.

Specified by:
getInputStream in interface Source
Overrides:
getInputStream in class AbstractSource
Returns:
InputStream
Throws:
java.io.IOException - if an IO error occurs
SourceException - if a source exception occurs
See Also:
Source.getInputStream()

exists

public boolean exists()
Whether this resource exists or not

Specified by:
exists in interface Source
Returns:
true if it does exist, false otherwise, false on error
See Also:
Source.exists()

canCancel

public boolean canCancel(java.io.OutputStream stream)
Whether we can cancel writing to the output stream

Specified by:
canCancel in interface ModifiableSource
Parameters:
stream - stream to cancel
Returns:
true if we can cancel, false otherwise
See Also:
ModifiableSource.canCancel(java.io.OutputStream)

cancel

public void cancel(java.io.OutputStream stream)
            throws java.io.IOException
Cancels writing to the specified output stream.

Specified by:
cancel in interface ModifiableSource
Parameters:
stream - stream to cancel writing to
Throws:
java.io.IOException - if an error occurs
See Also:
ModifiableSource.cancel(java.io.OutputStream)

delete

public void delete()
            throws SourceException
Deletes the source.

Specified by:
delete in interface ModifiableSource
Throws:
SourceException - if an error occurs
See Also:
ModifiableSource.delete()

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Obtain an OutputStream to the source

Specified by:
getOutputStream in interface ModifiableSource
Returns:
an OutputStream
Throws:
java.io.IOException
See Also:
ModifiableSource.getOutputStream()

enableLogging

public void enableLogging(Logger logger)
Enables logging for this source.

Specified by:
enableLogging in interface LogEnabled
Parameters:
logger - Logger instance to use
See Also:
#enableLogging(org.apache.avalon.framework.logger.Logger)


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.