Class FileSystemListenerList

  • All Implemented Interfaces:
    FileSystemListener

    public class FileSystemListenerList
    extends java.lang.Object
    implements FileSystemListener
    FileSystemListenerList maintains a list of FileSystemListener's. This class, acting as a FileSystemListener, simply relays each callback to all FileSystemListener's within its list. Employs either a synchronous and asynchronous notification mechanism.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileSystemListenerList​(boolean enableAsynchronousDispatching)
      Construct FileSystemListenerList
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(FileSystemListener listener)
      Add a listener to this list.
      void clear()
      Remove all listeners from this list.
      void dispose()  
      void folderCreated​(java.lang.String parentPath, java.lang.String folderName)
      Forwards folderCreated callback to all listeners within this list.
      void folderDeleted​(java.lang.String parentPath, java.lang.String folderName)
      Forwards folderDeleted callback to all listeners within this list.
      void folderMoved​(java.lang.String parentPath, java.lang.String folderName, java.lang.String newParentPath)
      Forwards folderMoved callback to all listeners within this list.
      void folderRenamed​(java.lang.String parentPath, java.lang.String folderName, java.lang.String newFolderName)
      Forwards folderRenamed callback to all listeners within this list.
      boolean isProcessingEvents()
      Returns true if this class is processing events or needs to process events that are in its event queue.
      void itemChanged​(java.lang.String parentPath, java.lang.String itemName)
      Forwards itemChanged callback to all listeners within this list.
      void itemCreated​(java.lang.String parentPath, java.lang.String itemName)
      Forwards itemCreated callback to all listeners within this list.
      void itemDeleted​(java.lang.String parentPath, java.lang.String itemName)
      Forwards itemDeleted callback to all listeners within this list.
      void itemMoved​(java.lang.String parentPath, java.lang.String name, java.lang.String newParentPath, java.lang.String newName)
      Forwards itemMoved callback to all listeners within this list.
      void itemRenamed​(java.lang.String parentPath, java.lang.String itemName, java.lang.String newName)
      Forwards itemRenamed callback to all listeners within this list.
      void remove​(FileSystemListener listener)
      Remove a listener from this list.
      void syncronize()
      Forwards syncronize callback to all listeners within this list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileSystemListenerList

        public FileSystemListenerList​(boolean enableAsynchronousDispatching)
        Construct FileSystemListenerList
        Parameters:
        enableAsynchronousDispatching - if true a separate dispatch thread will be used to notify listeners. If false, blocking notification will be performed.
    • Method Detail

      • dispose

        public void dispose()
      • add

        public void add​(FileSystemListener listener)
        Add a listener to this list.
        Parameters:
        listener -
      • remove

        public void remove​(FileSystemListener listener)
        Remove a listener from this list.
        Parameters:
        listener -
      • clear

        public void clear()
        Remove all listeners from this list.
      • itemMoved

        public void itemMoved​(java.lang.String parentPath,
                              java.lang.String name,
                              java.lang.String newParentPath,
                              java.lang.String newName)
        Forwards itemMoved callback to all listeners within this list.
        Specified by:
        itemMoved in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder that used to contain the item.
        name - the name of the item that was moved.
        newParentPath - the path of the folder that the item was moved to.
        newName - the new name of the item.
        See Also:
        FileSystemListener.itemMoved(String, String, String, String)
      • itemRenamed

        public void itemRenamed​(java.lang.String parentPath,
                                java.lang.String itemName,
                                java.lang.String newName)
        Forwards itemRenamed callback to all listeners within this list.
        Specified by:
        itemRenamed in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder that contains the renamed item
        itemName - the old name of the item.
        newName - the new name of the item.
        See Also:
        FileSystemListener.itemRenamed(String, String, String)
      • itemDeleted

        public void itemDeleted​(java.lang.String parentPath,
                                java.lang.String itemName)
        Forwards itemDeleted callback to all listeners within this list.
        Specified by:
        itemDeleted in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder that contained the deleted item.
        itemName - the name of the item that was deleted.
        See Also:
        FileSystemListener.itemDeleted(String, String)
      • folderRenamed

        public void folderRenamed​(java.lang.String parentPath,
                                  java.lang.String folderName,
                                  java.lang.String newFolderName)
        Forwards folderRenamed callback to all listeners within this list.
        Specified by:
        folderRenamed in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder containing the folder that was renamed.
        folderName - the old name of the folder.
        newFolderName - the new name of the folder.
        See Also:
        FileSystemListener.folderRenamed(String, String, String)
      • folderMoved

        public void folderMoved​(java.lang.String parentPath,
                                java.lang.String folderName,
                                java.lang.String newParentPath)
        Forwards folderMoved callback to all listeners within this list.
        Specified by:
        folderMoved in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder that used to contain the moved folder.
        folderName - the name of the folder that was moved.
        newParentPath - the path of the folder that now contains the moved folder.
        See Also:
        FileSystemListener.folderMoved(String, String, String)
      • folderDeleted

        public void folderDeleted​(java.lang.String parentPath,
                                  java.lang.String folderName)
        Forwards folderDeleted callback to all listeners within this list.
        Specified by:
        folderDeleted in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder that contained the deleted folder.
        folderName - the name of the folder that was deleted.
        See Also:
        FileSystemListener.folderDeleted(String, String)
      • itemCreated

        public void itemCreated​(java.lang.String parentPath,
                                java.lang.String itemName)
        Forwards itemCreated callback to all listeners within this list.
        Specified by:
        itemCreated in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder that contains the new item.
        itemName - the name of the new item.
        See Also:
        FileSystemListener.itemCreated(String, String)
      • folderCreated

        public void folderCreated​(java.lang.String parentPath,
                                  java.lang.String folderName)
        Forwards folderCreated callback to all listeners within this list.
        Specified by:
        folderCreated in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder that contains the new folder
        folderName - the name of the new folder
        See Also:
        FileSystemListener.folderCreated(String, String)
      • itemChanged

        public void itemChanged​(java.lang.String parentPath,
                                java.lang.String itemName)
        Forwards itemChanged callback to all listeners within this list.
        Specified by:
        itemChanged in interface FileSystemListener
        Parameters:
        parentPath - the path of the folder containing the item.
        itemName - the name of the item that has changed.
        See Also:
        FileSystemListener.itemChanged(String, String)
      • isProcessingEvents

        public boolean isProcessingEvents()
        Returns true if this class is processing events or needs to process events that are in its event queue.
        Returns:
        true if this class is processing events or needs to process events that are in its event queue.