Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.ide.file
Interface FileScope

All Known Implementing Classes:
AbstractFileScope, ContentSetScope, FileSetTable, FileTable

public interface FileScope

A scope in which files are monitored.

Since:
11.1.2

Method Summary
 void addFileChangeListener(FileChangeListener listener)
          Add a file change listener to receive events about the files in this scope.
 boolean contains(java.net.URL url)
          Determine whether this scope contains a URL.
 java.util.Collection<java.net.URL> getDirectories()
          Get the URLs of all directories in this scope.
 java.util.Collection<java.net.URL> getFiles()
          Get the URLs of all files in this scope.
 FileTable getFileTable(java.net.URL url)
          Get the file table in this scope containing a particular URL.
 java.util.Collection<FileTable> getFileTables()
          Get the file tables currently used by this scope.
 java.net.URL locate(java.lang.String relativePath)
          Locate a file in this scope.
 void refresh()
          Refresh this scope.
 void refresh(FileChangeListener listener)
          Refresh this scope and invoke a listener with any changes found.
 void removeFileChangeListener(FileChangeListener listener)
          Remove a file change listener from this scope.
 void update()
          Update this scope.
 

Method Detail

addFileChangeListener

void addFileChangeListener(@NotNull
                           FileChangeListener listener)
Add a file change listener to receive events about the files in this scope.

Parameters:
listener - the listener to be added

removeFileChangeListener

void removeFileChangeListener(@NotNull
                              FileChangeListener listener)
Remove a file change listener from this scope.

Parameters:
listener - the listener to be removed

getFileTables

java.util.Collection<FileTable> getFileTables()
Get the file tables currently used by this scope. A scope may span multiple file tables.

Returns:
the file tables used by this scope

getFileTable

FileTable getFileTable(java.net.URL url)
Get the file table in this scope containing a particular URL.

Parameters:
url - the URL
Returns:
the storage containing the URL, or null if no storages contain that URL

contains

boolean contains(java.net.URL url)
Determine whether this scope contains a URL. This does not check for existance of the URL.

Parameters:
url - the URL
Returns:
true if this scope contains the URL, false otherwise

locate

java.net.URL locate(java.lang.String relativePath)
                    throws java.io.IOException,
                           java.lang.InterruptedException
Locate a file in this scope.

Parameters:
relativePath - the relative path to the file
Returns:
the full URL of the file, or null if the file was not found in this scope
Throws:
java.lang.InterruptedException - if the calling thread is interrupted
java.io.IOException

getFiles

java.util.Collection<java.net.URL> getFiles()
                                            throws java.io.IOException,
                                                   java.lang.InterruptedException
Get the URLs of all files in this scope.

Returns:
the URLs of all files in this scope
Throws:
java.io.IOException - if the list of URLs could not be obtained
java.lang.InterruptedException - if the calling thread is interrupted

getDirectories

java.util.Collection<java.net.URL> getDirectories()
                                                  throws java.io.IOException,
                                                         java.lang.InterruptedException
Get the URLs of all directories in this scope.

Returns:
the URLs of all directories in this scope
Throws:
java.io.IOException - if the list of URLs could not be obtained
java.lang.InterruptedException - if the calling thread is interrupted

refresh

void refresh()
             throws java.lang.InterruptedException,
                    java.io.IOException
Refresh this scope. This brings the scope up to date with the current state of the files on disk. This is a very time consuming operation, and should not be called unless necesary. Clients of the File Change API should rarely, if ever, have a reason to call this method. It should typically only be called if the user has specifically requested that the files be refreshed. This should never be called on the event thread.

Throws:
java.lang.InterruptedException - if the calling thread is interrupted
java.io.IOException - if the refresh fails

update

void update()
            throws java.lang.InterruptedException,
                   java.io.IOException
Update this scope. This brings the scope up to date with the current state of the files on disk, if necessary. Unlike refresh(), the files on disk are only scanned if the file table is known to require a refresh. This is potentially a very time consuming operation, and should never be called on the event thread. This method exists for backward compatibility with older code that requires it. It should rarely, if ever, be necessary to call this method. The file scope is updated automatically whenever any method is called to access its data.

Throws:
java.lang.InterruptedException - if the calling thread is interrupted
java.io.IOException - if the update fails

refresh

void refresh(@Nullable
             FileChangeListener listener)
             throws java.lang.InterruptedException,
                    java.io.IOException
Refresh this scope and invoke a listener with any changes found. This brings the scope up to date with the current state of the files on disk. This is a very time consuming operation, and should not be called unless necesary. Clients of the File Change API should rarely, if ever, have a reason to call this method. It should typically only be called if the user has specifically requested that the files be refreshed. This should never be called on the event thread.

Throws:
java.lang.InterruptedException - if the calling thread is interrupted
java.io.IOException - if the refresh fails

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.