Web Site

org.codehaus.janino.util.resource
Class FileResource

java.lang.Object
  extended by org.codehaus.janino.util.resource.FileResource
All Implemented Interfaces:
Resource

public class FileResource
extends Object
implements Resource

Representation of a resource that is a File.


Constructor Summary
FileResource(File file)
           
 
Method Summary
 File getFile()
           
 String getFileName()
          Returns a decorative "file name" that can be used for reporting errors and the like.
 long lastModified()
          Returns the time of the last modification, in milliseconds since 1970, or 0L if the time of the last modification cannot be determined.
 InputStream open()
          Opens the resource.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileResource

public FileResource(File file)
Method Detail

getFileName

public final String 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 interface Resource

open

public final InputStream open()
                       throws IOException
Description copied from interface: Resource
Opens the resource. The caller is responsible for closing the InputStream.

Specified by:
open in interface Resource
Throws:
IOException

lastModified

public final long lastModified()
Description copied from interface: Resource
Returns the time of the last modification, in milliseconds since 1970, or 0L if the time of the last modification cannot be determined.

Specified by:
lastModified in interface Resource

getFile

public File getFile()

toString

public String toString()
Overrides:
toString in class Object

Web Site