org.stanwood.media.actions.rename
Class RenameAction

java.lang.Object
  extended by org.stanwood.media.actions.AbstractAction
      extended by org.stanwood.media.actions.rename.RenameAction
All Implemented Interfaces:
IAction, IExtension

public class RenameAction
extends AbstractAction

This action is used to rename media files in a media directory based on a pattern.

This action supports the following parameters


Constructor Summary
RenameAction()
           
 
Method Summary
 void perform(MediaDirectory dir, IEpisode episode, java.io.File mediaFile, IActionEventHandler actionEventHandler)
          Perform the rename action of the file files
 void perform(MediaDirectory dir, IFilm film, java.io.File mediaFile, java.lang.Integer part, IActionEventHandler actionEventHandler)
          Perform the rename action of the file files
 void performOnDirectory(MediaDirectory mediaDir, java.io.File dir, IActionEventHandler actionEventHandler)
          If the "pruneEmptyFolders" option has been set, then this will delete any empty directories it finds.
 void setParameter(java.lang.String key, java.lang.String value)
          Used to set the value of a parameter for this action.
 
Methods inherited from class org.stanwood.media.actions.AbstractAction
finished, init, isTestMode, resolvePatterns, setTestMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenameAction

public RenameAction()
Method Detail

perform

public void perform(MediaDirectory dir,
                    IFilm film,
                    java.io.File mediaFile,
                    java.lang.Integer part,
                    IActionEventHandler actionEventHandler)
             throws ActionException
Perform the rename action of the file files

Parameters:
film - The film information
part - The part number of the film, or null if it does not have parts
mediaFile - The media file
dir - File media directory the files belongs to
actionEventHandler - Used to notify the action performer about changes
Throws:
ActionException - Thrown if their is a problem with the action

perform

public void perform(MediaDirectory dir,
                    IEpisode episode,
                    java.io.File mediaFile,
                    IActionEventHandler actionEventHandler)
             throws ActionException
Perform the rename action of the file files

Parameters:
episode - The film information
mediaFile - The media file
dir - File media directory the files belongs to
actionEventHandler - Used to notify the action performer about changes
Throws:
ActionException - Thrown if their is a problem with the action

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
                  throws ActionException

Used to set the value of a parameter for this action.

This action supports the following parameters

Parameters:
key - The key of the parameter
value - The value of the parameter
Throws:
ActionException - Thrown if their is a problem setting the parameter

performOnDirectory

public void performOnDirectory(MediaDirectory mediaDir,
                               java.io.File dir,
                               IActionEventHandler actionEventHandler)
                        throws ActionException
If the "pruneEmptyFolders" option has been set, then this will delete any empty directories it finds.

Specified by:
performOnDirectory in interface IAction
Overrides:
performOnDirectory in class AbstractAction
Parameters:
mediaDir - The media directory
dir - The directory been checked
actionEventHandler - Thrown if their is a problem with the action
Throws:
ActionException - Thrown if their is a problem with the action