|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
net.shibboleth.utilities.java.support.resource.AbstractResource
public abstract class AbstractResource
Base class for resources.
| Field Summary | |
|---|---|
private String |
location
Location of the resource. |
| Constructor Summary | |
|---|---|
AbstractResource()
|
|
| Method Summary | |
|---|---|
protected abstract boolean |
doExists()
Checks whether the resource exists. |
protected abstract InputStream |
doGetInputStream()
Gets the input stream to the resource's data. |
protected abstract long |
doGetLastModifiedTime()
Gets the time, in milliseconds since the epoch, when the resource was last modified. |
protected void |
doValidate()
Performs the logic to validate this component. |
boolean |
equals(Object obj)
Two resources are considered equal if they are of the same type and and have the same location. |
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. |
int |
hashCode()
|
protected void |
setLocation(String resourceLocation)
Sets the resource location. |
String |
toString()
|
void |
validate()
Checks whether this component is valid and ready to be used. |
| Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent |
|---|
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| 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 |
| Field Detail |
|---|
private String location
| Constructor Detail |
|---|
public AbstractResource()
| Method Detail |
|---|
public final void validate()
throws ComponentValidationException
This method delegates to doValidate() if the component is not destroyed and is initialized.
validate in interface ValidatableComponentComponentValidationException - thrown if the component is not currently in a valid and usable state
@Nonnull
public final boolean exists()
throws ResourceException
This method delegates to doExists() if this component is not destroyed and is initialized.
exists in interface ResourceResourceException - thrown if there is a problem determining if the resource exists
@Nonnull
public final InputStream getInputStream()
throws ResourceException
This method delegates to doGetInputStream() if this component is not destroyed and is initialized.
getInputStream in interface ResourceResourceException - thrown if an input stream can not be created for the resource
@Nonnull
public final long getLastModifiedTime()
throws ResourceException
This method delegates to doGetLastModifiedTime() if this component is not destroyed and is initialized.
getLastModifiedTime in interface ResourceResourceException - thrown if the last modified time can not be determined@Nonnull public final String getLocation()
getLocation in interface Resource
public boolean equals(@Nullable
Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
protected void setLocation(@Nullable
String resourceLocation)
resourceLocation - the resource location
protected void doValidate()
throws ComponentValidationException
This implementation checks that the resource exists via exists().
ComponentValidationException - thrown if the component is not valid
@Nonnull
protected abstract boolean doExists()
throws ResourceException
ResourceException - thrown if there is a problem determining if the resource exists
@Nonnull
protected abstract InputStream doGetInputStream()
throws ResourceException
ResourceException - thrown if an input stream can not be created for the resource
@Nonnull
protected abstract long doGetLastModifiedTime()
throws ResourceException
ResourceException - thrown if the last modified time can not be determined
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||