org.stanwood.media.search
Class ReversePatternSearchStrategy

java.lang.Object
  extended by org.stanwood.media.search.ReversePatternSearchStrategy
All Implemented Interfaces:
ISearchStrategy

public class ReversePatternSearchStrategy
extends java.lang.Object
implements ISearchStrategy

This is a search strategy that tries to match the media directory pattern against the media file filename and work out it's search results from that.


Constructor Summary
ReversePatternSearchStrategy(Token termToken, boolean doComplexityCheck, boolean disallowIgnoreTokens)
          The constructor
 
Method Summary
 SearchDetails getSearch(java.io.File mediaFile, java.io.File rootMediaDir, java.lang.String renamePattern, MediaDirectory mediaDir)
          Look up the media file details using the renamePattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReversePatternSearchStrategy

public ReversePatternSearchStrategy(Token termToken,
                                    boolean doComplexityCheck,
                                    boolean disallowIgnoreTokens)
The constructor

Parameters:
termToken - The token type that would be used when searching for this file
doComplexityCheck - True to reject patterns that don't have a certian complexity
disallowIgnoreTokens - If true, them don't make if the file name contains ingored tokens
Method Detail

getSearch

public SearchDetails getSearch(java.io.File mediaFile,
                               java.io.File rootMediaDir,
                               java.lang.String renamePattern,
                               MediaDirectory mediaDir)
Look up the media file details using the renamePattern

Specified by:
getSearch in interface ISearchStrategy
Parameters:
mediaFile - The media file that is been processed
rootMediaDir - The root media directory
renamePattern - The pattern that is been used to rename media files
mediaDir - The media directory
Returns:
The search details