Package com.globalmentor.io
Class FileResource
java.lang.Object
com.globalmentor.net.AbstractResource
com.globalmentor.net.DefaultResource
com.globalmentor.io.FileResource
- All Implemented Interfaces:
Resource
,Comparable<Resource>
A resource accessible by a file. The file may or may not have the same URI as the resource.
- Author:
- Garret Wilson
-
Field Summary
Fields inherited from interface com.globalmentor.net.Resource
URI_PROPERTY_NAME
-
Constructor Summary
ConstructorDescriptionFileResource
(File file) Constructs a resource with a file.FileResource
(File file, URI referenceURI) Constructs a resource with a file and a reference URI. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves an list of child resources of this resource.getFile()
Methods inherited from class com.globalmentor.net.DefaultResource
compareTo, getURI, setURI
-
Constructor Details
-
FileResource
Constructs a resource with a file. The reference URI will be set to the reference URI of the file.- Parameters:
file
- The file this resource represents.- Throws:
NullPointerException
- if the given file or reference URI isnull
.
-
FileResource
Constructs a resource with a file and a reference URI.- Parameters:
file
- The file this resource represents.referenceURI
- The reference URI for the new resource.- Throws:
NullPointerException
- if the given file isnull
.
-
-
Method Details
-
getFile
- Returns:
- The file this resource represents.
-
getChildResources
Retrieves an list of child resources of this resource.- Returns:
- A list of child resources.
-