org.carrot2.util.resource
Class FileResource

java.lang.Object
  extended by org.carrot2.util.resource.FileResource
All Implemented Interfaces:
IResource

public final class FileResource
extends Object
implements IResource

A local filesystem resource. This loader provides cached content of returned resources and closes the underlying stream handle in open().


Constructor Summary
FileResource(File file)
           
 
Method Summary
 boolean equals(Object obj)
           
 File getFile()
           
 int hashCode()
           
 InputStream open()
          Open an input stream to the resource.
 String toString()
           
static FileResource valueOf(String path)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileResource

public FileResource(File file)
Method Detail

open

public InputStream open()
                 throws IOException
Description copied from interface: IResource
Open an input stream to the resource. Specific implementations may cache and close the underlying stream, but such behavior is not required by this interface. Please refer to the documentation of specific implementations for details.

Specified by:
open in interface IResource
Throws:
IOException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getFile

public File getFile()

valueOf

public static FileResource valueOf(String path)


Copyright (c) Dawid Weiss, Stanislaw Osinski