- java.lang.Object
-
- net.shibboleth.ext.spring.resource.ResourceHelper
-
-
Field Summary
Fields Modifier and Type Field Description private ResourcespringResourceThe cached SpringResource.
-
Constructor Summary
Constructors Modifier Constructor Description privateResourceHelper(Resource theResource)A private for shimming the provided input.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longcontentLength()ResourcecreateRelativeResource(String relativePath)booleanexists()StringgetDescription()FilegetFile()StringgetFilename()InputStreamgetInputStream()URIgetURI()URLgetURL()booleanisOpen()booleanisReadable()longlastModified()static Resourceof(Resource springResource)
-
-
-
Constructor Detail
-
ResourceHelper
private ResourceHelper(@Nonnull Resource theResource)A private for shimming the provided input.- Parameters:
theResource- the spring resource;
-
-
Method Detail
-
of
@Nonnull public static Resource of(@ParameterName(name="springResource") Resource springResource)
Return aResourcethat does all the work of the providedResource.If the input implements
Resourcethen it is cast to the output, other a shim class is generated.- Parameters:
springResource- the input- Returns:
- a
Resourcewhich reflects what the Spring one does
-
getInputStream
@Nonnull public InputStream getInputStream() throws IOException
- Specified by:
getInputStreamin interfaceResource- Throws:
IOException
-
isReadable
public boolean isReadable()
- Specified by:
isReadablein interfaceResource
-
getURL
public URL getURL() throws IOException
- Specified by:
getURLin interfaceResource- Throws:
IOException
-
getURI
public URI getURI() throws IOException
- Specified by:
getURIin interfaceResource- Throws:
IOException
-
getFile
public File getFile() throws IOException
- Specified by:
getFilein interfaceResource- Throws:
IOException
-
contentLength
public long contentLength() throws IOException- Specified by:
contentLengthin interfaceResource- Throws:
IOException
-
lastModified
public long lastModified() throws IOException- Specified by:
lastModifiedin interfaceResource- Throws:
IOException
-
createRelativeResource
public Resource createRelativeResource(String relativePath) throws IOException
- Specified by:
createRelativeResourcein interfaceResource- Throws:
IOException
-
getFilename
public String getFilename()
- Specified by:
getFilenamein interfaceResource
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceResource
-
-