com.anthonyeden.lib.resource
Class VFSResourceLoader

java.lang.Object
  extended bycom.anthonyeden.lib.resource.AbstractResourceLoader
      extended bycom.anthonyeden.lib.resource.VFSResourceLoader
All Implemented Interfaces:
ResourceLoader

public class VFSResourceLoader
extends AbstractResourceLoader

Implementation of the ResourceLoader interface which loads data from a virtual file system.

Author:
Anthony Eden

Field Summary
 
Fields inherited from class com.anthonyeden.lib.resource.AbstractResourceLoader
DEFAULT_DELAY
 
Constructor Summary
VFSResourceLoader()
           
 
Method Summary
 org.apache.commons.vfs.FileSystemManager getFileSystemManager()
          Get the FileSystemManager.
 void loadResource(java.lang.String path, ResourceRecipient handler)
          Load the resource specified by the given path.
 void loadResource(java.lang.String path, ResourceRecipient handler, boolean monitor)
          Load the resource specified by the given path.
 void setFileSystemManager(org.apache.commons.vfs.FileSystemManager fileSystemManager)
          Set the FileSystemManager.
 
Methods inherited from class com.anthonyeden.lib.resource.AbstractResourceLoader
getDelay, getMonitors, setDelay, startMonitors, stopMonitors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VFSResourceLoader

public VFSResourceLoader()
Method Detail

getFileSystemManager

public org.apache.commons.vfs.FileSystemManager getFileSystemManager()
                                                              throws org.apache.commons.vfs.FileSystemException
Get the FileSystemManager.

Returns:
The FileSystemManager
Throws:
org.apache.commons.vfs.FileSystemException

setFileSystemManager

public void setFileSystemManager(org.apache.commons.vfs.FileSystemManager fileSystemManager)
Set the FileSystemManager.

Parameters:
fileSystemManager - The new FileSystemManager

loadResource

public void loadResource(java.lang.String path,
                         ResourceRecipient handler)
                  throws ResourceException
Load the resource specified by the given path. Calling this method will cause the resource to be loaded and monitored.

Overrides:
loadResource in class AbstractResourceLoader
Parameters:
path - The path
handler - The ResourceReceipient callback
Throws:
ResourceException

loadResource

public void loadResource(java.lang.String path,
                         ResourceRecipient handler,
                         boolean monitor)
                  throws ResourceException
Load the resource specified by the given path. If monitor is true then the ResourceLoader implementation will monitor the resource and call the ResourceRecipient each time the resource is modified.

Parameters:
path - The path
handler - The ResourceRecipient callback
monitor - True to monitor the resource
Throws:
ResourceException


Copyright (c) 2000-2003 Anthony Eden. All Rights Reserved.