org.stanwood.media.actions.rename
Class FileNameParser

java.lang.Object
  extended by org.stanwood.media.actions.rename.FileNameParser

public class FileNameParser
extends java.lang.Object

Used to parse a filename and work out the correct season and episode number of the file. It does this my attempting to match a series of regular expressions against the file. It attempts to do a case insensitive match against each of the following regular expressions The first one that is matched, is used to get the episode and season number. Group 1 is always the season number and group 2 is always the episode number.


Constructor Summary
FileNameParser()
           
 
Method Summary
static ParsedFileName parse(java.io.File file)
          Parse the filename and work out the episode and season number.
static ParsedFileName parse(MediaDirConfig dirConfig, java.io.File file, SearchResult lookupResults)
          Parse the filename and work out the episode and season number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileNameParser

public FileNameParser()
Method Detail

parse

public static ParsedFileName parse(java.io.File file)
Parse the filename and work out the episode and season number. This does not use the media directory to do reverse pattern lookups.

Parameters:
file - The file been renamed
Returns:
The parsed information

parse

public static ParsedFileName parse(MediaDirConfig dirConfig,
                                   java.io.File file,
                                   SearchResult lookupResults)
Parse the filename and work out the episode and season number

Parameters:
dirConfig - The root media directory
file - The file been renamed
lookupResults - The results of a show/film search
Returns:
The parsed information