org.apache.james.services
Interface FileSystem

All Known Implementing Classes:
AvalonFileSystem, FileSystemBridge

public interface FileSystem

This service is used by components that wants to lookup a File resource from the application folder.

Since:
James 2.4

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 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)
          to retrieve a resource.
 

Field Detail

ROLE

static final java.lang.String ROLE
See Also:
Constant Field Values
Method Detail

getResource

java.io.InputStream getResource(java.lang.String url)
                                throws java.io.IOException
to retrieve a resource. this is typically a file resource, but depending on the implementation, this could also be from classpath or from another source.

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

getFile

java.io.File getFile(java.lang.String fileURL)
                     throws java.io.FileNotFoundException
Used to retrieve a specific file in the application context

Parameters:
fileURL - file
Returns:
the File found
Throws:
java.io.FileNotFoundException - if the file cannot be found/read

getBasedir

java.io.File getBasedir()
                        throws java.io.FileNotFoundException
Return the base folder used by the application

Throws:
java.io.FileNotFoundException


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