org.stanwood.media.actions
Class AbstractAction

java.lang.Object
  extended by org.stanwood.media.actions.AbstractAction
All Implemented Interfaces:
IAction, IExtension
Direct Known Subclasses:
ExecuteSystemCommandAction, PodCastAction, RenameAction

public abstract class AbstractAction
extends java.lang.Object
implements IAction

Helper class that actions should extends so that they only have to implement action methods that are needed.


Constructor Summary
AbstractAction()
           
 
Method Summary
 void finished(MediaDirectory dir)
          This is called once for each action after they have finished performing on all media files within the media directory.
 void init(MediaDirectory dir)
          This is called once before any of the media files are processed to allow the action to perform setup tasks
 boolean isTestMode()
          Used to find out if test mode is enabled
 void performOnDirectory(MediaDirectory dir, java.io.File file, IActionEventHandler actionEventHandler)
          This is called so the action can perform on directories within the media directory
protected  java.lang.String resolvePatterns(MediaDirectory dir, java.lang.String input, IVideo video, java.io.File mediaFile, java.lang.Integer part)
           
 void setTestMode(boolean testMode)
          Used to notify the action if test mode is enabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.stanwood.media.actions.IAction
perform, perform, setParameter
 

Constructor Detail

AbstractAction

public AbstractAction()
Method Detail

setTestMode

public void setTestMode(boolean testMode)
Used to notify the action if test mode is enabled

Specified by:
setTestMode in interface IAction
Parameters:
testMode - True if test mode is enabled, otherwise false

isTestMode

public boolean isTestMode()
Used to find out if test mode is enabled

Specified by:
isTestMode in interface IAction
Returns:
True if test mode is enabled, otherwise false

performOnDirectory

public void performOnDirectory(MediaDirectory dir,
                               java.io.File file,
                               IActionEventHandler actionEventHandler)
                        throws ActionException
This is called so the action can perform on directories within the media directory

Specified by:
performOnDirectory in interface IAction
Parameters:
dir - The media directory
file - The directory the action is to perform on
actionEventHandler - Used to notify the action performer about changes
Throws:
ActionException - Thrown if their is a problem with the action

init

public void init(MediaDirectory dir)
          throws ActionException
This is called once before any of the media files are processed to allow the action to perform setup tasks

Specified by:
init in interface IAction
Parameters:
dir - The media directory
Throws:
ActionException - Thrown if their is a problem with the action

finished

public void finished(MediaDirectory dir)
              throws ActionException
This is called once for each action after they have finished performing on all media files within the media directory.

Specified by:
finished in interface IAction
Parameters:
dir - The media directory
Throws:
ActionException - Thrown if their is a problem with the action

resolvePatterns

protected java.lang.String resolvePatterns(MediaDirectory dir,
                                           java.lang.String input,
                                           IVideo video,
                                           java.io.File mediaFile,
                                           java.lang.Integer part)
                                    throws ActionException
Throws:
ActionException