Class LockFileEventImpl

  • All Implemented Interfaces:
    Event, FileEvent, LockFileEvent

    public class LockFileEventImpl
    extends FileEventImpl
    implements LockFileEvent
    An event for files and their lock files, that is, an event is produced and sent as soon as a file (or a directory) is created or stored in a specific folder.
    This event source terminates as soon as an event has been handled. However, since it polls, one has to ensure that a handled file is deleted or moved to another folder. Otherwise the source will create another event for the file.
    Author:
    Ulrich Kreher, Marco Waimer
    • Field Detail

      • lockPath

        protected final Path lockPath
        The path of the lock file for which the event has been created.
      • lockAttributes

        protected final BasicFileAttributes lockAttributes
        The file attributes of the path of the lock file.
    • Constructor Detail

      • LockFileEventImpl

        public LockFileEventImpl​(URI[] managerURI,
                                 String eventType,
                                 String sourceType,
                                 String sourceID,
                                 Path path,
                                 Path lockPath)
                          throws IOException
        Creates a new event for the designated file.
        Parameters:
        managerURI - The URIs of the service (event manager) creating the event.
        eventType - The type of the event.
        sourceType - The type of the source of this event.
        sourceID - The ID of the source of this event.
        path - The path for which the event has been created.
        lockPath - The path of the lock file for which the event has been created.
        Throws:
        IOException - If retrieving the basic file attributes of the designated path fails, an IOException will be thrown.
    • Method Detail

      • getLockPath

        public Path getLockPath()
        Description copied from interface: LockFileEvent
        Gets the path of the lock file of this event.
        Specified by:
        getLockPath in interface LockFileEvent
        Returns:
        The path of the lock file of this event.
      • getLockFileAttributes

        public BasicFileAttributes getLockFileAttributes()
        Description copied from interface: LockFileEvent
        Gets the basic file attributes of the lock file of this event.
        Specified by:
        getLockFileAttributes in interface LockFileEvent
        Returns:
        The basic file attributes of the path of the lock file of this event.