Class FileResource
java.lang.Object
org.codehaus.commons.compiler.util.resource.FileResource
- All Implemented Interfaces:
LocatableResource
,Resource
Representation of a resource that is a
File
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal File
getFile()
final String
Returns a decorative "file name" that can be used for reporting errors and the like.final long
Returns the time of the last modification, in milliseconds since 1970, or0L
if the time of the last modification cannot be determined.final InputStream
open()
Opens the resource.final String
toString()
-
Field Details
-
file
-
-
Constructor Details
-
FileResource
-
-
Method Details
-
getLocation
- Specified by:
getLocation
in interfaceLocatableResource
- Returns:
- A locator that addresses this resource's contents
- Throws:
IOException
-
getFileName
Description copied from interface:Resource
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!- Specified by:
getFileName
in interfaceResource
-
open
Description copied from interface:Resource
Opens the resource. The caller is responsible for closing theInputStream
.- Specified by:
open
in interfaceResource
- Throws:
IOException
-
lastModified
public final long lastModified()Description copied from interface:Resource
Returns the time of the last modification, in milliseconds since 1970, or0L
if the time of the last modification cannot be determined.- Specified by:
lastModified
in interfaceResource
-
getFile
- Returns:
- The file containing the contents of this resource
-
toString
-