public class FileSystemResourceHandler extends Object implements ResourceHandler
| Constructor and Description |
|---|
FileSystemResourceHandler(String documentRootDirPath,
String charset,
MessageLog messageLog)
Creates a new
FileSystemResourceHandler. |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getResourceAsInputStream(String path)
Returns the resource input stream for the provided path.
|
OutputStream |
getResourceAsOutputStream(String path)
Returns the resource output stream for the provided path.
|
Reader |
getResourceAsReader(String path)
Returns the reader for the provided path.
|
Writer |
getResourceAsWriter(String path)
Returns the writer for the provided path.
|
String |
getResourcePath(String baseFile,
String filePath)
This implementation detects if the resource path starts with a "/" and resolves
such resources against the provided
SmartSpritesParameters.getDocumentRootDir() directory. |
public FileSystemResourceHandler(String documentRootDirPath, String charset, MessageLog messageLog)
FileSystemResourceHandler.documentRootDirPath - the document root directory path, can be nullcharset - the charset to assume in the getResourceAsReader(String)
methodmessageLog - the message logpublic InputStream getResourceAsInputStream(String path) throws IOException
ResourceHandlergetResourceAsInputStream in interface ResourceHandlerpath - the resource pathnull if the resource could not be
opened.IOExceptionpublic Reader getResourceAsReader(String path) throws IOException
ResourceHandlergetResourceAsReader in interface ResourceHandlerpath - the resource pathnull if the resource could not be opened.IOExceptionpublic OutputStream getResourceAsOutputStream(String path) throws IOException
ResourceHandlergetResourceAsOutputStream in interface ResourceHandlerpath - the resource pathnull if the resource could not be
opened.IOExceptionpublic Writer getResourceAsWriter(String path) throws IOException
ResourceHandlergetResourceAsWriter in interface ResourceHandlerpath - the resource pathnull if the resource could not be opened.IOExceptionpublic String getResourcePath(String baseFile, String filePath)
SmartSpritesParameters.getDocumentRootDir() directory.getResourcePath in interface ResourceHandlerbaseFile - the CSS file path (base)filePath - the relative path to be resolved against the cssFilePath. If
the resource path starts with the '/' character, it is an absolute
resource and should be resolved against the
SmartSpritesParameters.getDocumentRootDir() path instead. All
other resource paths should be assumed to be relative to the
cssFilePath.Copyright © 2013 Carrot Search s.c.. All Rights Reserved.