org.ckkloverdos.resource
Interface IResource

All Known Implementing Classes:
ClassLoaderResource, EmptyResource, FileResource

public interface IResource

A resource abstraction, inspired as a generalization of the API provided by ClassLoader to obtain resources.

Author:
Christos KK Loverdos

Method Summary
 boolean exists()
          Returns true iff the resource exists.
 java.io.File getFile()
          Returns the resource file.
 java.io.InputStream getInputStream()
          Returns an input stream used to read the resource bytes.
 java.lang.String getName()
          Returns the resource name.
 java.net.URL getURL()
          Returns the resource URL.
 boolean isFile()
          Returns true iff the resource is actually a local file.
 

Method Detail

getName

java.lang.String getName()
Returns the resource name.


getURL

java.net.URL getURL()
Returns the resource URL.


getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns an input stream used to read the resource bytes.

Throws:
java.io.IOException

exists

boolean exists()
Returns true iff the resource exists.


isFile

boolean isFile()
Returns true iff the resource is actually a local file.


getFile

java.io.File getFile()
Returns the resource file. If isFile() returns true, then the actual file is returned, otherwise null.



Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.