public class ActionPerformer extends java.lang.Object implements IActionEventHandler
Constructor and Description |
---|
ActionPerformer(Controller controller,
java.util.List<IAction> actions,
MediaDirectory dir,
java.util.List<java.lang.String> exts)
Constructor used to create a instance of the class
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<java.io.File> |
findMediaFiles(IProgressMonitor monitor) |
void |
performActions(IProgressMonitor monitor)
Used to perform the actions
|
void |
performActions(java.util.List<java.io.File> files,
java.util.Set<java.io.File> dirs,
IProgressMonitor parentMonitor)
Used to perform the actions
|
void |
sendEventAboutToRenamedFile(java.io.File oldFile,
java.io.File newFile)
This is called when a file in a media directory is about to be renamed
|
void |
sendEventDeletedFile(java.io.File file)
Listen for the delete file event and remove it from the stores
|
void |
sendEventNewFile(java.io.File file)
Listen for the new file event and perform the actions on it
|
void |
sendEventRenamedFile(java.io.File oldFile,
java.io.File newFile)
Listen for the rename file event and and update stores
|
public ActionPerformer(Controller controller, java.util.List<IAction> actions, MediaDirectory dir, java.util.List<java.lang.String> exts) throws ConfigException
controller
- The controlleractions
- List of actions to performdir
- The media directoryexts
- The extensions to search forConfigException
- Thrown if their is a problem reading the configpublic void performActions(IProgressMonitor monitor) throws ActionException
monitor
- Progress monitorActionException
- Thrown if their are any errors with the actionspublic void performActions(java.util.List<java.io.File> files, java.util.Set<java.io.File> dirs, IProgressMonitor parentMonitor) throws ActionException
files
- The files to perform the actions ondirs
- The directories with the media directoryparentMonitor
- Progress monitor parentActionException
- Thrown if their are any errors with the actionsprotected java.util.List<java.io.File> findMediaFiles(IProgressMonitor monitor) throws ActionException
ActionException
public void sendEventNewFile(java.io.File file) throws ActionException
sendEventNewFile
in interface IActionEventHandler
file
- the FileActionException
- Thrown if their are any problemspublic void sendEventDeletedFile(java.io.File file)
sendEventDeletedFile
in interface IActionEventHandler
file
- the Filepublic void sendEventRenamedFile(java.io.File oldFile, java.io.File newFile) throws ActionException
sendEventRenamedFile
in interface IActionEventHandler
oldFile
- The old filenamenewFile
- The new filenameActionException
- Thrown if their are any problemspublic void sendEventAboutToRenamedFile(java.io.File oldFile, java.io.File newFile) throws ActionException
sendEventAboutToRenamedFile
in interface IActionEventHandler
oldFile
- The old name of the filenewFile
- The new name of the fileActionException
- Thrown if their are any problems