org.codehaus.janino.util.resource

Interface Resource

public interface Resource

A Resource is "something" that is typically found by a ResourceFinder, can be opened for reading, and optionally has a lastModified property.

There also exists a ResourceCreator concept which opens a resource for writing, but that happens directly and not through an intermediate Resource object.

See Also: ResourceFinder ResourceCreator

Method Summary
StringgetFileName()
Returns a decorative "file name" that can be used for reporting errors and the like.
longlastModified()
Returns the time of the last modification, in milliseconds since 1970, or 0L if the time of the last modification cannot be determined.
InputStreamopen()
Opens the resource.

Method Detail

getFileName

public String getFileName()
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!

lastModified

public 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.

open

public InputStream open()
Opens the resource. The caller is responsible for closing the java.io.InputStream.