Class FileEventImpl
java.lang.Object
de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
de.aristaflow.adept2.core.eventmanager.fileevents.FileEventImpl
- Direct Known Subclasses:
LockFileEventImpl
An event for 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.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BasicFileAttributesThe file attributes of the path.protected final PathThe path for which the event has been created.Fields inherited from class de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
creationTime, eventType, id, ID_COUNT, managerURI, sourceID, sourceType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the basic file attributes of the path of this event.getPath()Gets the path that caused this event.static UDTValuegetUdtValue(Path filePath, String udtName) Gets the UDT value with the designated type name for the designated file.Methods inherited from class de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
getCreationTime, getEventManager, getEventType, getID, getSourceID, getSourceTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.aristaflow.adept2.model.events.Event
getCreationTime, getEventManager, getEventType, getID, getSourceID, getSourceType
-
Field Details
-
path
The path for which the event has been created. -
attributes
The file attributes of the path.
-
-
Constructor Details
-
FileEventImpl
public FileEventImpl(URI[] managerURI, String eventType, String sourceType, String sourceID, Path path) throws IOException Creates a new event for the designated path.- 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.- Throws:
IOException- If retrieving the basic file attributes of the designated path fails, anIOExceptionwill be thrown.
-
-
Method Details
-
getPath
Description copied from interface:FileEventGets the path that caused this event. -
getFileAttributes
Description copied from interface:FileEventGets the basic file attributes of the path of this event.- Specified by:
getFileAttributesin interfaceFileEvent- Returns:
- The basic file attributes of the path of this event.
-
getUdtValue
public static UDTValue getUdtValue(Path filePath, String udtName) throws IOException, MalformedURLException Gets the UDT value with the designated type name for the designated file.- Parameters:
filePath- The path specifying the file to retrieve.udtName- The type name of the UDT.- Returns:
- The UDT value of the designated type name for the designated file. The caller is responsible for closing.
- Throws:
IOException- If there are problems creating theFileUDTorUDTValuefrom the path or an URI, anIOExceptionwill be thrown.MalformedURLException- If the URI of the path cannot be converted to URL, aMalformedURLExceptionwill be thrown.
-