net.shibboleth.utilities.java.support.resource
Class FilesystemResource
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
net.shibboleth.utilities.java.support.resource.AbstractResource
net.shibboleth.utilities.java.support.resource.FilesystemResource
- All Implemented Interfaces:
- Component, DestructableComponent, InitializableComponent, ValidatableComponent, Resource
public class FilesystemResource
- extends AbstractResource
An Resource that reads data from a fileystem file.
|
Method Summary |
protected boolean |
doExists()
Checks whether the resource exists. |
protected InputStream |
doGetInputStream()
Gets the input stream to the resource's data. |
protected long |
doGetLastModifiedTime()
Gets the time, in milliseconds since the epoch, when the resource was last modified. |
resourceFile
private final File resourceFile
- Filesytem file read by this resource.
FilesystemResource
public FilesystemResource(String resourcePath)
- Constructor. The file character set is set to the system default character set.
- Parameters:
resourcePath - file read by this resource, never null or empty
doExists
protected boolean doExists()
throws ResourceException
- Checks whether the resource exists.
- Specified by:
doExists in class AbstractResource
- Returns:
- true if the resource exists, false if not
- Throws:
ResourceException - thrown if there is a problem determining if the resource exists
doGetInputStream
protected InputStream doGetInputStream()
throws ResourceException
- Gets the input stream to the resource's data.
- Specified by:
doGetInputStream in class AbstractResource
- Returns:
- input stream to the resource's data
- Throws:
ResourceException - thrown if an input stream can not be created for the resource
doGetLastModifiedTime
protected long doGetLastModifiedTime()
throws ResourceException
- Gets the time, in milliseconds since the epoch, when the resource was last modified.
- Specified by:
doGetLastModifiedTime in class AbstractResource
- Returns:
- time, in milliseconds since the epoch, when the resource was last modified
- Throws:
ResourceException - thrown if the last modified time can not be determined
Copyright © 1999-2012. All Rights Reserved.