org.apache.james.context
Class AvalonFileSystem

java.lang.Object
  extended by org.apache.james.context.AvalonFileSystem
All Implemented Interfaces:
org.apache.avalon.framework.context.Contextualizable, FileSystem

public class AvalonFileSystem
extends java.lang.Object
implements FileSystem, org.apache.avalon.framework.context.Contextualizable

Avalon implementation of the FileSystem service

Since:
2.4

Field Summary
 
Fields inherited from interface org.apache.james.services.FileSystem
ROLE
 
Constructor Summary
AvalonFileSystem()
           
 
Method Summary
 void contextualize(org.apache.avalon.framework.context.Context context)
           
 java.io.File getBasedir()
          Return the base folder used by the application
 java.io.File getFile(java.lang.String fileURL)
          Used to retrieve a specific file in the application context
 java.io.InputStream getResource(java.lang.String url)
          delegates to method getFile() and returns file as InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvalonFileSystem

public AvalonFileSystem()
Method Detail

getResource

public java.io.InputStream getResource(java.lang.String url)
                                throws java.io.IOException
delegates to method getFile() and returns file as InputStream.

Specified by:
getResource in interface FileSystem
Parameters:
url - the url of the resource
Returns:
the resource as an input stream
Throws:
java.io.IOException - if the resource could not be accessed
See Also:
getFile(java.lang.String)

getFile

public java.io.File getFile(java.lang.String fileURL)
                     throws java.io.FileNotFoundException
Description copied from interface: FileSystem
Used to retrieve a specific file in the application context

Specified by:
getFile in interface FileSystem
Parameters:
fileURL - file
Returns:
the File found
Throws:
java.io.FileNotFoundException - if the file cannot be found/read
See Also:
FileSystem.getFile(java.lang.String)

getBasedir

public java.io.File getBasedir()
                        throws java.io.FileNotFoundException
Description copied from interface: FileSystem
Return the base folder used by the application

Specified by:
getBasedir in interface FileSystem
Throws:
java.io.FileNotFoundException
See Also:
FileSystem.getBasedir()

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.