org.gcube.common.scan.resources
Class FileResource

java.lang.Object
  extended by org.gcube.common.scan.resources.FileResource
All Implemented Interfaces:
ClasspathResource

public class FileResource
extends Object
implements ClasspathResource

A ClasspathResource that lives in a directory archive.

Author:
Fabio Simeoni

Constructor Summary
FileResource(String absolutePath, String relativePath)
          Creates an instance from its absolute path on the file system, and from the its path relative to archive that contains it.
 
Method Summary
 File file()
          Returns the resource as a file
 String name()
          Returns the name of the resource.
 String path()
          Returns the path of the resource, relatively to the containing archive.
 InputStream stream()
          Returns the resource as a stream.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileResource

public FileResource(String absolutePath,
                    String relativePath)
Creates an instance from its absolute path on the file system, and from the its path relative to archive that contains it.

Parameters:
absolutePath - the absolute path
relativePath - the relative path
Method Detail

name

public String name()
Description copied from interface: ClasspathResource
Returns the name of the resource.

Specified by:
name in interface ClasspathResource
Returns:

path

public String path()
Description copied from interface: ClasspathResource
Returns the path of the resource, relatively to the containing archive.

Specified by:
path in interface ClasspathResource
Returns:

stream

public InputStream stream()
Description copied from interface: ClasspathResource
Returns the resource as a stream.

Specified by:
stream in interface ClasspathResource
Returns:
the stream

file

public File file()
Description copied from interface: ClasspathResource
Returns the resource as a file

Specified by:
file in interface ClasspathResource
Returns:
the file

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.