de.scheisseichfindemalkeinen.rules
Class RulePipeline

java.lang.Object
  extended by de.scheisseichfindemalkeinen.rules.RulePipeline

public class RulePipeline
extends java.lang.Object

RulePipeline


Field Summary
static int RULEPIPELINE_MODE_CONTAINER_URL
          Replace in Container-URL
static int RULEPIPELINE_MODE_FILENAME_CONTAINER_PAGE_SOURCECODE
          Use Container-Page-Sourcecode from first URL for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_CONTAINER_URL
          Use Container-URL for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_CONTAINER_URL_FILENAME_PART
          Use Container-URL-Filename-Part for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_DOWNLOAD_URL
          Use Download-URL for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_DOWNLOAD_URL_FILENAME_PART
          Use Download-URL-Filename-Part for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_FIRST_CONTAINER_PAGE_SOURCECODE
          Use First Container-Page-Sourcecode for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_PAGE_SOURCECODE
          Use Last Container-Page-Sourcecode for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_URL
          Use Last Container-URL for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_URL_FILENAME_PART
          Use Last Container-URL-Filename-Part for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_THUMBNAIL_URL
          Use Thumbnail-URL for Filename Search and Replace
static int RULEPIPELINE_MODE_FILENAME_THUMBNAIL_URL_FILENAME_PART
          Use Thumbnail-URL-Filename-Part for Filename Search and Replace
static int RULEPIPELINE_MODE_THUMBNAIL_URL
          Replace in Thumbnail-URL
 
Constructor Summary
RulePipeline(org.jdom.Element e)
          Constructor
RulePipeline(int mode)
          Constructor
 
Method Summary
 void addRegExp(RuleRegExp rre)
          Adds a RuleRegExp to the pipeline
 java.lang.String getCorrectedFilename(java.lang.String url, java.lang.String thumbURL, java.lang.String htmlcode, Pic pic)
          Returns the filename after replacement
 java.lang.String getCorrectedFilenameOnDownloadSelection(java.lang.String url)
          Returns the filename after replacement
 int getFilenameDownloadSelectionMode()
          Returns the filenameDownloadSelectionMode
 int getFilenameMode()
          Returns the filenameMode
 int getMode()
          Returns the mode
 RuleRegExp getRegexp(int index)
          Returns the RuleRegExp
 java.util.Vector<RuleRegExp> getRegexps()
          Returns all RuleRegExps
 boolean getStatusOK()
          Returns if the status of the object is ok
 java.lang.String getURL(java.lang.String url, java.lang.String thumbURL, java.lang.String htmlcode, Pic pic)
          Returns parsed URL
 int getURLMode()
          Returns the UrlMode
 int getWaitBeforeExecute()
          Returns the waitBeforeExecute
 org.jdom.Element getXmlElement()
          Returns the Element for creating the XML-File
 void removeRegExp(int index)
          Removes a RuleRegExp from the pipeline
 void setFilenameDownloadSelectionMode(int filenameDownloadSelectionMode)
          Sets the filenameDownloadSelectionMode
 void setFilenameMode(int filenameMode)
          Sets the filenameMode
 void setMode(int mode)
          Sets the Mode
 void setURLMode(int urlMode)
          Sets the UrlMode
 void setWaitBeforeExecute(int waitBeforeExecute)
          Sets the waitBeforeExecute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RULEPIPELINE_MODE_CONTAINER_URL

public static final int RULEPIPELINE_MODE_CONTAINER_URL
Replace in Container-URL

See Also:
Constant Field Values

RULEPIPELINE_MODE_THUMBNAIL_URL

public static final int RULEPIPELINE_MODE_THUMBNAIL_URL
Replace in Thumbnail-URL

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_CONTAINER_URL_FILENAME_PART

public static final int RULEPIPELINE_MODE_FILENAME_CONTAINER_URL_FILENAME_PART
Use Container-URL-Filename-Part for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_CONTAINER_URL

public static final int RULEPIPELINE_MODE_FILENAME_CONTAINER_URL
Use Container-URL for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_THUMBNAIL_URL_FILENAME_PART

public static final int RULEPIPELINE_MODE_FILENAME_THUMBNAIL_URL_FILENAME_PART
Use Thumbnail-URL-Filename-Part for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_THUMBNAIL_URL

public static final int RULEPIPELINE_MODE_FILENAME_THUMBNAIL_URL
Use Thumbnail-URL for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_CONTAINER_PAGE_SOURCECODE

public static final int RULEPIPELINE_MODE_FILENAME_CONTAINER_PAGE_SOURCECODE
Use Container-Page-Sourcecode from first URL for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_DOWNLOAD_URL

public static final int RULEPIPELINE_MODE_FILENAME_DOWNLOAD_URL
Use Download-URL for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_DOWNLOAD_URL_FILENAME_PART

public static final int RULEPIPELINE_MODE_FILENAME_DOWNLOAD_URL_FILENAME_PART
Use Download-URL-Filename-Part for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_URL_FILENAME_PART

public static final int RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_URL_FILENAME_PART
Use Last Container-URL-Filename-Part for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_URL

public static final int RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_URL
Use Last Container-URL for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_FIRST_CONTAINER_PAGE_SOURCECODE

public static final int RULEPIPELINE_MODE_FILENAME_FIRST_CONTAINER_PAGE_SOURCECODE
Use First Container-Page-Sourcecode for Filename Search and Replace

See Also:
Constant Field Values

RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_PAGE_SOURCECODE

public static final int RULEPIPELINE_MODE_FILENAME_LAST_CONTAINER_PAGE_SOURCECODE
Use Last Container-Page-Sourcecode for Filename Search and Replace

See Also:
Constant Field Values
Constructor Detail

RulePipeline

public RulePipeline(int mode)
Constructor

Parameters:
mode - Mode

RulePipeline

public RulePipeline(org.jdom.Element e)
Constructor

Parameters:
e - Element
Method Detail

getStatusOK

public boolean getStatusOK()
Returns if the status of the object is ok

Returns:
True if ok

getXmlElement

public org.jdom.Element getXmlElement()
Returns the Element for creating the XML-File

Returns:
Element

getMode

public int getMode()
Returns the mode

Returns:
Mode

setMode

public void setMode(int mode)
Sets the Mode

Parameters:
mode - Mode

getURLMode

public int getURLMode()
Returns the UrlMode

Returns:
UrlMode

setURLMode

public void setURLMode(int urlMode)
Sets the UrlMode

Parameters:
urlMode - UrlMode

getFilenameMode

public int getFilenameMode()
Returns the filenameMode

Returns:
filenameMode

setFilenameMode

public void setFilenameMode(int filenameMode)
Sets the filenameMode

Parameters:
filenameMode - filenameMode

getFilenameDownloadSelectionMode

public int getFilenameDownloadSelectionMode()
Returns the filenameDownloadSelectionMode

Returns:
filenameDownloadSelectionMode

setFilenameDownloadSelectionMode

public void setFilenameDownloadSelectionMode(int filenameDownloadSelectionMode)
Sets the filenameDownloadSelectionMode

Parameters:
filenameDownloadSelectionMode - filenameDownloadSelectionMode

getURL

public java.lang.String getURL(java.lang.String url,
                               java.lang.String thumbURL,
                               java.lang.String htmlcode,
                               Pic pic)
                        throws HostException
Returns parsed URL

Parameters:
url - Container-URL
thumbURL - Thumbnail-URL
htmlcode - Sourcecode
pic - Pic
Returns:
URL
Throws:
HostException

getCorrectedFilename

public java.lang.String getCorrectedFilename(java.lang.String url,
                                             java.lang.String thumbURL,
                                             java.lang.String htmlcode,
                                             Pic pic)
Returns the filename after replacement

Parameters:
url - URL
thumbURL - Thumbnail-URL
htmlcode - Container-Page-Sourcecode
pic - Pic
Returns:
Filename

getCorrectedFilenameOnDownloadSelection

public java.lang.String getCorrectedFilenameOnDownloadSelection(java.lang.String url)
Returns the filename after replacement

Parameters:
url - URL
Returns:
Filename

getRegexps

public java.util.Vector<RuleRegExp> getRegexps()
Returns all RuleRegExps

Returns:
RuleRegExps

getRegexp

public RuleRegExp getRegexp(int index)
Returns the RuleRegExp

Parameters:
index - Index in the array
Returns:
RuleRegExp

addRegExp

public void addRegExp(RuleRegExp rre)
Adds a RuleRegExp to the pipeline

Parameters:
rre - RuleRegExp

removeRegExp

public void removeRegExp(int index)
Removes a RuleRegExp from the pipeline

Parameters:
index - Index in the array

getWaitBeforeExecute

public int getWaitBeforeExecute()
Returns the waitBeforeExecute

Returns:
waitBeforeExecute

setWaitBeforeExecute

public void setWaitBeforeExecute(int waitBeforeExecute)
Sets the waitBeforeExecute

Parameters:
waitBeforeExecute - waitBeforeExecute