net.datacrow.filerenamer
Class FilePattern
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
FilePattern
public FilePattern(java.lang.String pattern,
int module)
- Creates a new instance.
- Parameters:
pattern
- String representation of the pattern.module
- The module index.
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