net.shibboleth.utilities.java.support.resource
Interface Resource

All Superinterfaces:
Component, DestructableComponent, InitializableComponent, ValidatableComponent
All Known Implementing Classes:
AbstractResource, ClasspathResource, FilesystemResource, HttpResource

public interface Resource
extends DestructableComponent, InitializableComponent, ValidatableComponent

An interface representing an data resource.


Method Summary
 boolean exists()
          Checks whether the resource exists.
 InputStream getInputStream()
          Gets the input stream to the resource's data.
 long getLastModifiedTime()
          Gets the time, in milliseconds since the epoch, when the resource was last modified.
 String getLocation()
          Gets resource location information.
 
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
 
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
 
Methods inherited from interface net.shibboleth.utilities.java.support.component.ValidatableComponent
validate
 

Method Detail

getLocation

@Nonnull
String getLocation()
Gets resource location information. Examples might be filesystem path, URL, etc.

Returns:
resource location information

exists

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

@Nonnull
InputStream getInputStream()
                           throws ResourceException
Gets the input stream to the resource's data.

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

getLastModifiedTime

long getLastModifiedTime()
                         throws ResourceException
Gets the time, in milliseconds since the epoch, when the resource was last modified.

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.