FileSystemSvc.I Interface

com.bea.ide.filesystem
FileSystemSvc.I Interface

public static interface FileSystemSvc.I

This service keeps a list of all the files of interest to the filesystem and will generate notifications of changes to those files to interested listeners.


All Known Subinterfaces

FileSystemSvc.IAdvanced
Enclosing class

FileSystemSvc

Method Summary

public void
addFileSystemListener(FileSystemListener listener, URI listenTarget)
Add a FileSystemListener to a FileSystem.
public List
addFileSystemListener(FileSystemListener listener, URI listenTarget, IFileFilter filter)
Add a FileSystemListener to a FileSystem.
public int
countIFiles(URI rootURI)
Returns the file count for the files inside the rootURI.
public int
countIFiles(URI rootURI, IFileFilter filter)
Returns the file count for the files inside the rootUIR that pass the filter's accept test.
public ArrayList
getIFiles(URI rootDir)
Returns a complete recursive list of all the files below the root passed in.
public ArrayList
getIFiles(URI rootDir, IFileFilter filter)
Returns a recursive list of all the files below the root passed in, filtered by the IFileFilter.
public ArrayList
getIFiles(URI rootDir, IFileFilter filter, boolean recursive)
Returns an optionally-recursive list of all the files in the rootDir, filtered byte IFileFilter.
public ArrayList
getIFilesAndDirs(URI rootDir, IFileFilter filter)
Returns an optionally-recursive list of all the files and directories in the rootDir, filtered byte IFileFilter.
public void
removeFileSystemListener(FileSystemListener listener, URI listenTarget)
Remove a FileSystemListener for a specific target from a FileSystem.
public void
removeFileSystemListener(FileSystemListener listener)
Remove a FileSystemListener from all targets in the FileSystem.

Method Detail

addFileSystemListener(FileSystemListener, URI) Method

public void addFileSystemListener(FileSystemListener listener, 
                                  URI listenTarget)
Add a FileSystemListener to a FileSystem. FileSystemChanged events are sent to the listener whenever the listened-to file changes, or is created, or is deleted. For directories, any changes to files inside the directory result in a change event fired on the directory as well. This method populates the file cache asynchronously by default, therefore the listener may receive new file events for files that exist at the time the listener is added if they have not yet been added to the file cache. If the user wants to avoid these events, the listener needs to implement the FileSystemListener.Completion interface. This will be called when the file cache has completed loading the initial state. The listener is then added and will be notified of new files.

Parameters

listener
a FileSystemListener object to be notified when an event occurs.
listenTarget
a directory or file to listen for changes on.

Related Topics

FileSystemListener.Completion


addFileSystemListener(FileSystemListener, URI, IFileFilter) Method

public List addFileSystemListener(FileSystemListener listener, 
                                  URI listenTarget, 
                                  IFileFilter filter)
Add a FileSystemListener to a FileSystem. FileSystemChanged events are sent to the listener whenever the listened-to file changes, or is created, or is deleted. For directories, any changes to files inside the directory result in a change event fired on the directory as well. This method is sychronous and returns the set of files in the system at the time the listener was added. The listener will not receive any "NEW" notifications for these files and is guaranteed to receive notifications for any files not in this list that appear. NOTE: this list will never contain directories

Parameters

listener
a FileSystemListener object to be notified when an event occurs.
listenTarget
a directory or file to listen for changes on.
filter
filter implementation used to filter the list of files returned. This may be null to indicate all files.

Returns

list of IFile objects representing the files that were in the system at the time the listener was added.

countIFiles(URI) Method

public int countIFiles(URI rootURI)
Returns the file count for the files inside the rootURI. It does not count directories, just files.

Parameters

rootURI
the URI to the root directory to start scanning.

Returns

the number of files under the root.

countIFiles(URI, IFileFilter) Method

public int countIFiles(URI rootURI, 
                       IFileFilter filter)
Returns the file count for the files inside the rootUIR that pass the filter's accept test. It does not count directories, just files.

Parameters

rootURI
the URI to the root directory to start scanning.
filter
an IFileFilter to use to accept files into the count.

Returns

the number of files under the root.

getIFiles(URI) Method

public ArrayList getIFiles(URI rootDir)
Returns a complete recursive list of all the files below the root passed in. The returned list contains IFiles and does not contain directories. If the directory doesn't exist or contains no files, an empty List is returned.

The rootDir URI must use the '/' separator and must end with a '/' character. Use IFile.getURI() to get this automatically.

This list is guaranteed to be complete, meaning the directory structure will be fully scanned before returning the list.

Parameters

rootDir
the URI to the root directory to start scanning.

Returns

an ArrayList of IFiles, if any.

getIFiles(URI, IFileFilter) Method

public ArrayList getIFiles(URI rootDir, 
                           IFileFilter filter)
Returns a recursive list of all the files below the root passed in, filtered by the IFileFilter. The returned list contains IFiles and does not contain directories. If the directory doesn't exist or contains no files, an empty list is returned.

The rootDir URI must use the '/' separator and must end with a '/' character. Use IFile.getURI() to get this automatically.

This list is guaranteed to be complete, meaning the directory structure will be fully scanned before returning the list.

Parameters

rootDir
the URI to the root directory to start scanning.
filter
an IFileFilter to use to accept files into the list.

Returns

an ArrayList of IFiles, if any.

getIFiles(URI, IFileFilter, boolean) Method

public ArrayList getIFiles(URI rootDir, 
                           IFileFilter filter, 
                           boolean recursive)
Returns an optionally-recursive list of all the files in the rootDir, filtered byte IFileFilter. The returned list contains IFiles and does not contain directories. If the directory doesn't exist or contains no files, an empty list is returned.

The rootDir URI must use the '/' separator and must end with a '/' character. Use IFile.getURI() to get this automatically.

This list is guaranteed to be complete, meaning the directory structure will be fully scanned before returning the list.

Parameters

rootDir
the URI to the root directory to start scanning.
filter
an IFileFilter to use to accept files into the list.
recursive
true means get files in subdirectories.

Returns

an ArrayList of IFiles, if any.

getIFilesAndDirs(URI, IFileFilter) Method

public ArrayList getIFilesAndDirs(URI rootDir, 
                                  IFileFilter filter)
Returns an optionally-recursive list of all the files and directories in the rootDir, filtered byte IFileFilter. If the directory doesn't exist or contains no files, an empty list is returned.

The rootDir URI must use the '/' separator and must end with a '/' character. Use IFile.getURI() to get this automatically.

This list is guaranteed to be complete, meaning the directory structure will be fully scanned before returning the list.

This variation of getIFiles does not havea recursive parameter, because it is presumed that the caller is asking for directories so they can do the recursion themselves.

Parameters

rootDir
the URI to the root directory to start scanning.
filter
an IFileFilter to use to accept files into the list.

Returns

an ArrayList of IFiles, if any.

removeFileSystemListener(FileSystemListener, URI) Method

public void removeFileSystemListener(FileSystemListener listener, 
                                     URI listenTarget)
Remove a FileSystemListener for a specific target from a FileSystem.

Parameters

listener
a FileSystemListener object to remove from the listener list.
listenTarget
a directory or file that the listener is no longer interested in.

removeFileSystemListener(FileSystemListener) Method

public void removeFileSystemListener(FileSystemListener listener)
Remove a FileSystemListener from all targets in the FileSystem. Useful when the listener object is going away entirely.

Parameters

listener
a FileSystemListener object to remove from the listener list.