org.sapia.clazzy.loader
Class FileSystemLoader

java.lang.Object
  |
  +--org.sapia.clazzy.loader.FileSystemLoader
All Implemented Interfaces:
Loader, URLEnabled

public class FileSystemLoader
extends Object
implements Loader, URLEnabled

Implements the Loader interface over a file directory.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2004 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Constructor Summary
FileSystemLoader(File baseDir)
           
 
Method Summary
 void close()
          Releases all resources that this instance holds.
 File getBaseDir()
           
 URL getURL()
           
 URL getURL(String resourceName)
           
 byte[] loadBytes(String resourceName)
          Loads a the bytes of the specified resources and returns them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemLoader

public FileSystemLoader(File baseDir)
Method Detail

getBaseDir

public File getBaseDir()

getURL

public URL getURL()
           throws MalformedURLException
Specified by:
getURL in interface URLEnabled
Returns:
the URL of the File representing the base directory to which this instance corresponds.
Throws:
MalformedURLException

getURL

public URL getURL(String resourceName)
Specified by:
getURL in interface Loader
Parameters:
resourceName - the name of a resource.
Returns:
the URL corresponding to the given resource.
See Also:
Loader.getURL(java.lang.String)

loadBytes

public byte[] loadBytes(String resourceName)
Description copied from interface: Loader
Loads a the bytes of the specified resources and returns them.

Specified by:
loadBytes in interface Loader
Parameters:
resourceName -
Returns:
an array of bytes, or null if no resource could be found for the given name, or if the bytes could not be loaded for some reason.
See Also:
Loader.loadBytes(java.lang.String)

close

public void close()
Description copied from interface: Loader
Releases all resources that this instance holds.

Specified by:
close in interface Loader
See Also:
Loader.close()


Copyright © 2002 Sapia Open Community, Inc. All Rights Reserved.