com.triangularpixels.rebirth.resources
Class FileSystemMonitor

java.lang.Object
  extended by com.triangularpixels.rebirth.resources.FileSystemMonitor
All Implemented Interfaces:
FileMonitor, Runnable

public class FileSystemMonitor
extends Object
implements Runnable, FileMonitor


Constructor Summary
FileSystemMonitor(ResourceIO resourceIO)
           
 
Method Summary
 void addListener(String filePath, FileModifiedListener listener)
           
 void destroy()
           
 boolean isMonitored(String path)
           
 void removeListener(String filePath, FileModifiedListener listener)
           
 void run()
           
 void setStabilityThreshold(int newThreshold)
          Sets the number of ticks that a file's length must remain constant before we decide that it's stable and listeners can be informed
 void setTimeout(int newTimeout)
          Sets the timeout (in ticks) that we'll re-check files for before we give up and assume they've been deleted
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemMonitor

public FileSystemMonitor(ResourceIO resourceIO)
Method Detail

destroy

public void destroy()
Specified by:
destroy in interface FileMonitor

setTimeout

public void setTimeout(int newTimeout)
Sets the timeout (in ticks) that we'll re-check files for before we give up and assume they've been deleted


setStabilityThreshold

public void setStabilityThreshold(int newThreshold)
Sets the number of ticks that a file's length must remain constant before we decide that it's stable and listeners can be informed


addListener

public void addListener(String filePath,
                        FileModifiedListener listener)
Specified by:
addListener in interface FileMonitor

removeListener

public void removeListener(String filePath,
                           FileModifiedListener listener)
Specified by:
removeListener in interface FileMonitor

update

public void update()
Specified by:
update in interface FileMonitor

isMonitored

public boolean isMonitored(String path)
Specified by:
isMonitored in interface FileMonitor

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2009 TriangularPixels.com. All Rights Reserved.