GigaSpaces XAP 8.0 API

com.sun.jini.system
Class FileObserver

java.lang.Object
  extended by com.sun.jini.system.FileObserver
All Implemented Interfaces:
Observer

public class FileObserver
extends Object
implements Observer

Observer class that gets notified when a change has been noted, that is a file has been found, by an Observable object. This class is normally passed into a class that extends Observable

Author:
Sun Microsystems, Inc.
See Also:
Observable, Observer, FileWalker

Constructor Summary
FileObserver(String suffix)
          Constructor that allows the user to specify interest in a particular suffix.
 
Method Summary
 ArrayList getFileList()
          Get the complete list of found files.
 ArrayList getFileTimeList()
          Get the time stamps of the found files.
 void update(Observable o, Object arg)
          Called when an Observer monitors a change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileObserver

public FileObserver(String suffix)
Constructor that allows the user to specify interest in a particular suffix. Only files with the provide suffix will be saved and returned to the user. All others will fall through.

If suffix is an empty string then all files will be matched.

Method Detail

update

public void update(Observable o,
                   Object arg)
Called when an Observer monitors a change. When a change is noted by the item being observed, in this case the given root build directory, this method gets called.

Specified by:
update in interface Observer

getFileList

public ArrayList getFileList()
Get the complete list of found files. The list contains String representations of the file names.

Returns:
ArrayList - List of found files.

getFileTimeList

public ArrayList getFileTimeList()
Get the time stamps of the found files. There is a 1-1 correspondence with the contents of getFileList. The lit contains Long representations of the file time stamps.

Returns:
ArrayList - List of found files date stamps
See Also:
getFileList()

GigaSpaces XAP 8.0 API

Copyright © GigaSpaces.