org.opensaml.util.resource
Class FilesystemResource

java.lang.Object
  extended by org.opensaml.util.resource.AbstractFilteredResource
      extended by org.opensaml.util.resource.FilesystemResource
All Implemented Interfaces:
Resource

public class FilesystemResource
extends AbstractFilteredResource

A resource representing a file on the local filesystem.


Constructor Summary
FilesystemResource(java.lang.String resourcePath)
          Constructor.
FilesystemResource(java.lang.String resourcePath, ResourceFilter resourceFilter)
          Constructor.
FilesystemResource(java.net.URI resourceURI)
          Constructor.
FilesystemResource(java.net.URI resourceURI, ResourceFilter resourceFilter)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          
 boolean exists()
          Checks whether the resource exists.
 java.io.InputStream getInputStream()
          Gets the inputstream to the resource's data.
 org.joda.time.DateTime getLastModifiedTime()
          Gets the date and time the resource was last modified.
 java.lang.String getLocation()
          Gets resource location information.
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class org.opensaml.util.resource.AbstractFilteredResource
getResourceFilter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilesystemResource

public FilesystemResource(java.lang.String resourcePath)
                   throws ResourceException
Constructor.

Parameters:
resourcePath - the path to the file for this resource
Throws:
ResourceException - thrown if the resource path is null or empty

FilesystemResource

public FilesystemResource(java.net.URI resourceURI)
                   throws ResourceException
Constructor.

Parameters:
resourceURI - file: URI to the file
Throws:
ResourceException - thrown if the resource path is null or empty
Since:
1.2.0

FilesystemResource

public FilesystemResource(java.lang.String resourcePath,
                          ResourceFilter resourceFilter)
                   throws ResourceException
Constructor.

Parameters:
resourcePath - the path to the file for this resource
resourceFilter - filter to apply to this resource
Throws:
ResourceException - thrown if the resource path is null or empty

FilesystemResource

public FilesystemResource(java.net.URI resourceURI,
                          ResourceFilter resourceFilter)
                   throws ResourceException
Constructor.

Parameters:
resourceURI - the file: URI to the file for this resource
resourceFilter - filter to apply to this resource
Throws:
ResourceException - thrown if the resource path is null or empty
Since:
1.2.0
Method Detail

exists

public boolean exists()
               throws ResourceException
Checks whether the resource exists.

Returns:
true if the resource exists, false if not
Throws:
ResourceException - thrown if there is a problem determining if the resource exists

getInputStream

public java.io.InputStream getInputStream()
                                   throws ResourceException
Gets the inputstream to the resource's data.

Returns:
inputstream to the resource's data
Throws:
ResourceException - thrown if an input stream can not be created for the resource

getLastModifiedTime

public org.joda.time.DateTime getLastModifiedTime()
                                           throws ResourceException
Gets the date and time the resource was last modified.

Returns:
date and time the resource was last modified
Throws:
ResourceException - thrown if the last modified time can not be determined

getLocation

public java.lang.String getLocation()
Gets resource location information. Examples might be filesystem path, URL, etc.

Returns:
resource location information

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object


Copyright © 2006-2009 Internet2. All Rights Reserved.