Package com.globalmentor.io
Class FileResource
- java.lang.Object
-
- com.globalmentor.net.AbstractResource
-
- com.globalmentor.net.DefaultResource
-
- com.globalmentor.io.FileResource
-
public class FileResource extends DefaultResource
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
Constructors Constructor Description FileResource(java.io.File file)
Constructs a resource with a file.FileResource(java.io.File file, java.net.URI referenceURI)
Constructs a resource with a file and a reference URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<FileResource>
getChildResources()
Retrieves an list of child resources of this resource.java.io.File
getFile()
-
Methods inherited from class com.globalmentor.net.DefaultResource
compareTo, getURI, setURI
-
-
-
-
Constructor Detail
-
FileResource
public FileResource(java.io.File file)
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:
java.lang.NullPointerException
- if the given file or reference URI isnull
.
-
FileResource
public FileResource(java.io.File file, java.net.URI referenceURI)
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:
java.lang.NullPointerException
- if the given file isnull
.
-
-
Method Detail
-
getFile
public java.io.File getFile()
- Returns:
- The file this resource represents.
-
getChildResources
public java.util.List<FileResource> getChildResources()
Retrieves an list of child resources of this resource.- Returns:
- A list of child resources.
-
-