org.objectledge.filesystem
Class ServletFileSystemProvider

java.lang.Object
  extended by org.objectledge.filesystem.impl.ReadOnlyFileSystemProvider
      extended by org.objectledge.filesystem.ServletFileSystemProvider
All Implemented Interfaces:
FileSystemProvider

public class ServletFileSystemProvider
extends ReadOnlyFileSystemProvider

An implementation of FileSystem provider that operates on the ServletContext.

This is a read-only implementation. It is able to use WEB-INF/files for listing functionality.

Version:
$Id: ServletFileSystemProvider.java,v 1.5 2005/08/03 10:22:23 pablo Exp $
Author:
Rafal Krzewski

Field Summary
private  javax.servlet.ServletContext context
          the servlet context used for reading resources.
 
Fields inherited from class org.objectledge.filesystem.impl.ReadOnlyFileSystemProvider
LISTING_ENCODING, LISTING_LOCATION, name
 
Constructor Summary
ServletFileSystemProvider(String name, javax.servlet.ServletContext context)
          Crates a new instance of the provider.
 
Method Summary
 InputStream getInputStream(String path)
          
 URL getResource(String path)
          
 
Methods inherited from class org.objectledge.filesystem.impl.ReadOnlyFileSystemProvider
canRead, canWrite, checkPathChars, createNewFile, delete, exists, getName, getOutputStream, getRandomAccess, isDirectory, isFile, isReadOnly, lastModified, length, list, mkdirs, processListing, processListings, rename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

private javax.servlet.ServletContext context
the servlet context used for reading resources.

Constructor Detail

ServletFileSystemProvider

public ServletFileSystemProvider(String name,
                                 javax.servlet.ServletContext context)
Crates a new instance of the provider.

Parameters:
name - the name of the provider.
context - the servlet context to read resources from.
Method Detail

getInputStream

public InputStream getInputStream(String path)

Specified by:
getInputStream in interface FileSystemProvider
Specified by:
getInputStream in class ReadOnlyFileSystemProvider

getResource

public URL getResource(String path)
                throws MalformedURLException

Throws:
MalformedURLException


Copyright © 2003-2006 objectledge.org. All Rights Reserved.