Web Site

org.codehaus.janino.util.resource
Class FileResource

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

public class FileResource
extends java.lang.Object
implements Resource

Representation of a resource that is a File.


Constructor Summary
FileResource(java.io.File file)
           
 
Method Summary
 java.io.File getFile()
           
 java.lang.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.
 java.io.InputStream open()
          Opens the resource.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileResource

public FileResource(java.io.File file)
Method Detail

getFileName

public final java.lang.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 java.io.InputStream open()
                               throws java.io.IOException
Description copied from interface: Resource
Opens the resource. The caller is responsible for closing the InputStream.

Specified by:
open in interface Resource
Throws:
java.io.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 java.io.File getFile()

toString

public java.lang.String toString()

Web Site