Interface Resource
-
- All Known Subinterfaces:
LocatableResource
- All Known Implementing Classes:
FileResource,StringResource
public interface ResourceA sequence of bytes that is identified by a "name", is typically found by aResourceFinder, can beopen()ed for reading, and optionally has alastModified()property.There also exists a
ResourceCreatorconcept which opens a resource for writing, but that happens directly and not through an intermediateResourceobject.- See Also:
ResourceFinder,ResourceCreator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetFileName()Returns a decorative "file name" that can be used for reporting errors and the like.longlastModified()Returns the time of the last modification, in milliseconds since 1970, or0Lif the time of the last modification cannot be determined.java.io.InputStreamopen()Opens the resource.
-
-
-
Method Detail
-
open
java.io.InputStream open() throws java.io.IOExceptionOpens the resource. The caller is responsible for closing theInputStream.- Throws:
java.io.IOException
-
getFileName
java.lang.String getFileName()
Returns a decorative "file name" that can be used for reporting errors and the like. It does not necessarily map to a file in the local file system!
-
lastModified
long lastModified()
Returns the time of the last modification, in milliseconds since 1970, or0Lif the time of the last modification cannot be determined.
-
-