Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.ide.net
Class URLFileSystemEvent

java.lang.Object
  extended by java.util.EventObject
      extended by oracle.ide.net.URLFileSystemEvent
All Implemented Interfaces:
java.io.Serializable

public class URLFileSystemEvent
extends java.util.EventObject

The URLFileSystemEvent provides details as to URL changes that occurred on directory roots that listeners are tracking. Events are generated when a file or directory is added, changed, renamed, or removed within the directory tree of the registered root URL.

For FILE_RENAMED and DIRECTORY_RENAMED events, at least one of the new URL or old URL (or both) will be contained in the registered root URL directory. Clients cannot assume that both the new and old URLs are contained in the root URL.

See Also:
Serialized Form

Field Summary
static int DIRECTORY_ADDED
          The event type for when a directory was created type of event.
static int DIRECTORY_REMOVED
          The event type for when a directory was removed type of event.
static int DIRECTORY_RENAMED
          The event type for when a directory was renamed.
static int FILE_ADDED
          The event type for when a file was created type of event.
static int FILE_CHANGED
          The event type for when a file was modified type of event.
static int FILE_REMOVED
          The event type for when a file was removed type of event.
static int FILE_RENAMED
          The event type for when a file was renamed.
static int READ_ONLY_CHANGED
          The event type for when the read-only status of a file changes.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
URLFileSystemEvent(java.net.URL[] rootURLs, java.net.URL affectedURL, int eventType)
          Construct an URLFileSystemEvent for an add/change/remove type event.
URLFileSystemEvent(java.net.URL[] rootURLs, java.net.URL newURL, java.net.URL oldURL, int eventType)
          Construct an URLFileSystemEvent for a rename type event.
 
Method Summary
 int getEventType()
          Fetch the event type that occurred, such as FILE_ADDED, FILE_CHANGED, or FILE_REMOVED.
protected  java.lang.String getEventTypeString()
          Fetch the debug string describing the event type for this event.
protected static java.lang.String getEventTypeString(int eventType)
          Fetch the debug string describing the given event type.
 java.net.URL getNewURL()
          Fetch the new URL for a rename event.
 java.net.URL getOldURL()
          Fetch the old URL for a file or directory rename event.
 java.net.URL[] getRootURLs()
          Fetch the root URLs that were registered for events for this listener.
 java.net.URL getURL()
          Fetch the URL that this event occurred for.
static boolean isValidEventType(int eventType)
          Fetch whether this is a known event type.
 java.lang.String toString()
          Readable version of event for debugging purposes.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILE_ADDED

public static final int FILE_ADDED
The event type for when a file was created type of event.

See Also:
Constant Field Values

FILE_CHANGED

public static final int FILE_CHANGED
The event type for when a file was modified type of event. A file is considered modified when its last modified date, or its file size changes. Changing a file's read-only status or hidden status does not change the file, and will not generate a file changed event.

See Also:
Constant Field Values

FILE_REMOVED

public static final int FILE_REMOVED
The event type for when a file was removed type of event.

See Also:
Constant Field Values

FILE_RENAMED

public static final int FILE_RENAMED
The event type for when a file was renamed.

See Also:
Constant Field Values

DIRECTORY_ADDED

public static final int DIRECTORY_ADDED
The event type for when a directory was created type of event. Clients should not assume the directory is empty however, as it may have been an existing directory that was moved.

See Also:
Constant Field Values

DIRECTORY_REMOVED

public static final int DIRECTORY_REMOVED
The event type for when a directory was removed type of event. Clients should not assume the directory was empty prior to its removal however, as it may have been an existing directory that was moved to a new location.

See Also:
Constant Field Values

DIRECTORY_RENAMED

public static final int DIRECTORY_RENAMED
The event type for when a directory was renamed.

See Also:
Constant Field Values

READ_ONLY_CHANGED

public static final int READ_ONLY_CHANGED
The event type for when the read-only status of a file changes.

See Also:
Constant Field Values
Constructor Detail

URLFileSystemEvent

public URLFileSystemEvent(java.net.URL[] rootURLs,
                          java.net.URL affectedURL,
                          int eventType)
Construct an URLFileSystemEvent for an add/change/remove type event.

Parameters:
rootURLs - the root URLs that this listener is registered to track
affectedURL - the affected URL
eventType - the event type indicating what happened with the URL

URLFileSystemEvent

public URLFileSystemEvent(java.net.URL[] rootURLs,
                          java.net.URL newURL,
                          java.net.URL oldURL,
                          int eventType)
Construct an URLFileSystemEvent for a rename type event.

Parameters:
rootURLs - the root URLs that this listener is registered to track
newURL - the new URL for which this rename event applies to
oldURL - the old URL in the case of a rename event
eventType - the event type indicating what happened with the URL
Method Detail

isValidEventType

public static boolean isValidEventType(int eventType)
Fetch whether this is a known event type.

Parameters:
eventType - the event type to validate
Returns:
true if this is a valid event type

getRootURLs

public java.net.URL[] getRootURLs()
Fetch the root URLs that were registered for events for this listener. The URL for this event is contained within these root URL directories.

Returns:
the root URLs registered for events

getURL

public java.net.URL getURL()
Fetch the URL that this event occurred for. The event type indicates whether the file for this URL was added, changed or removed. In the case of a rename event, this is the new URL.

Returns:
the URL for this event, or the new URL in the case of a rename event

getNewURL

public java.net.URL getNewURL()
Fetch the new URL for a rename event. For all other events, this just returns the changed URL.

Returns:
the new URL for a rename event, or the changed URL for all other events

getOldURL

public java.net.URL getOldURL()
Fetch the old URL for a file or directory rename event. Returns null for all other event types.

Returns:
the old URL for a rename event

getEventType

public int getEventType()
Fetch the event type that occurred, such as FILE_ADDED, FILE_CHANGED, or FILE_REMOVED.

Returns:
the event that occurred

getEventTypeString

protected java.lang.String getEventTypeString()
Fetch the debug string describing the event type for this event.

Returns:
the description of the event type for this event

getEventTypeString

protected static java.lang.String getEventTypeString(int eventType)
Fetch the debug string describing the given event type.

Parameters:
eventType - the event type to fetch the description of
Returns:
the description of the event type

toString

public java.lang.String toString()
Readable version of event for debugging purposes.

Overrides:
toString in class java.util.EventObject

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

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