net.datacrow.filerenamer
Class FilePattern

java.lang.Object
  extended by net.datacrow.filerenamer.FilePattern

public class FilePattern
extends java.lang.Object

A file pattern decides how the filename should be formed, using information from an item.

Author:
Robert Jan van der Waals

Constructor Summary
FilePattern(java.lang.String pattern, int module)
          Creates a new instance.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getFilename(DcObject dco, java.io.File oldFile, java.io.File baseDir)
          Creates the new filename based on information from the item.
 int getModule()
           
 java.util.Collection<FilePatternPart> getParts()
           
 java.lang.String getPattern()
           
 int hashCode()
           
 java.lang.String toStorageString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilePattern

public FilePattern(java.lang.String pattern,
                   int module)
Creates a new instance.

Parameters:
pattern - String representation of the pattern.
module - The module index.
Method Detail

getModule

public int getModule()

getPattern

public java.lang.String getPattern()

getParts

public java.util.Collection<FilePatternPart> getParts()

getFilename

public java.lang.String getFilename(DcObject dco,
                                    java.io.File oldFile,
                                    java.io.File baseDir)
Creates the new filename based on information from the item.

Parameters:
dco -
oldFile - The current file.
baseDir - The current base directory.
Returns:
The new filename.

toStorageString

public java.lang.String toStorageString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object