Interface Resource
-
Method Summary
Modifier and TypeMethodDescriptionbooleanexists()Check if this resource actually exists in physical form.Returns the filename of the resource.getPath()Get full path of resource.booleanCheck if this resource is a directory.Get all sub-resources: if the resource is not a directory, then this method should returns an empty list.Open anInputStream.toFile()Return a File handle for this resource.
-
Method Details
-
exists
boolean exists()Check if this resource actually exists in physical form.- Returns:
trueif the resource exists,falseotherwise.
-
toFile
File toFile()Return a File handle for this resource.- Returns:
- The file associated to this resource.
-
openStream
Open anInputStream. It is expected that each call of this method returns a new fresh instance ofInputStream.- Returns:
- New
InputStream. - Throws:
IOException- If theInputStreamcannot be opened.
-
getFilename
-
getPath
-
isDirectory
boolean isDirectory()Check if this resource is a directory.- Returns:
trueif the resource is a directory,falseotherwise.
-
listResources
Collection<Resource> listResources()Get all sub-resources: if the resource is not a directory, then this method should returns an empty list.- Returns:
- Sub-resources.
-