|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.scheisseichfindemalkeinen.hoster.Hoster
de.scheisseichfindemalkeinen.rules.Rule
public class Rule
A Rule can be defined by the user. The input is then the Container-URL or the Sourcecode of the Container-URL. The user can define if the rule should do a replacement in the Container-URL or download the Container-Page and do a replacement there. For the replacement Regular Expressions are used. There also the possibillity to do a replacement for a nicer filename. A rule has for all those modes pipelines. So in a pipeline multiple replacements can be defined. A rule is stored as an XML-File.
| Field Summary | |
|---|---|
static int |
DUPLICATES_BH_DEFAULT
DUPLICATES_BH_DEFAULT |
static int |
DUPLICATES_CONTAINER_URL_AND_THUMBNAIL_URL
DUPLICATES_CONTAINER_URL_AND_THUMBNAIL_URL |
static int |
DUPLICATES_CONTAINER_URL_ONLY
DUPLICATES_CONTAINER_URL_ONLY |
static int |
DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITH_THUMB_THUMBS_ALWAYS_FIRST
DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITH_THUMB_THUMBS_ALWAYS_FIRST |
static int |
DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITH_THUMB_THUMBS_ALWAYS_LAST
DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITH_THUMB_THUMBS_ALWAYS_LAST |
static int |
DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITHOUT_THUMB_THUMBS_ALWAYS_FIRST
DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITHOUT_THUMB_THUMBS_ALWAYS_FIRST |
static int |
DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITHOUT_THUMB_THUMBS_ALWAYS_LAST
DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITHOUT_THUMB_THUMBS_ALWAYS_LAST |
static org.apache.log4j.Logger |
logger
Logger for this class |
static int |
REFERRER_CUSTOM
Custom string as referrer |
static int |
REFERRER_FIRST_CONTAINER_URL
Last Container-URL as referrer |
static int |
REFERRER_LAST_CONTAINER_URL
Last Container-URL as referrer |
static int |
REFERRER_NO_REFERRER
No referrer |
static int |
REFERRER_ORIGIN_PAGE
Origin-Page (Referrer-URL) as referrer |
static int |
RULE_MODE_CONTAINER_OR_THUMBNAIL_URL
Replace in Container-URL or Thumbnail-URL |
static int |
RULE_MODE_CONTAINER_PAGE_SOURCECODE
Replace in Container-Page-Sourcecode |
static int |
RULE_MODE_FILENAME
Replace Filename |
static int |
RULE_MODE_FILENAME_ON_DOWNLOAD_SELECTION
Replace Filename |
| Constructor Summary | |
|---|---|
Rule(java.lang.String file)
Constructor |
|
Rule(java.lang.String name,
java.lang.String version,
int mode,
java.lang.String pattern,
java.lang.String file)
Constructor |
|
| Method Summary | |
|---|---|
static java.lang.String |
downloadContainerPage(java.lang.String url,
java.lang.String referrer)
Downloads and Returns the sourcecode of a Container-Page |
java.lang.String |
getCustomReferrer()
Returns the customReferrer |
java.lang.String |
getCustomReferrerDownload()
Returns the customReferrerDownload |
int |
getDuplicateRemoveMode()
Returns the duplicateRemoveMode |
java.io.File |
getFile()
Returns the path of the XML-File |
java.lang.String |
getFilename(java.lang.String url)
Returns the filename after replacement |
java.util.Vector<java.lang.String> |
getMaxConnectionDomains()
Returns the maxConnectionDomains |
int |
getMaxConnections()
Returns the maxConnections |
java.lang.String |
getName()
Returns the name |
java.lang.String |
getPattern()
Returns the Container-URL-Pattern |
RulePipeline |
getPipelineFilename()
Returns the pipelineFilename |
RulePipeline |
getPipelineFilenameDownloadSelection()
Returns the pipelineFilenameDownloadSelection |
java.util.Vector<RulePipeline> |
getPipelines()
Returns the pipelines Filename- and Filename-on-Download-Selection pipelines are not included |
int |
getReferrerMode()
Returns the referrerMode |
int |
getReferrerModeDownload()
Returns the referrerModeDownload |
boolean |
getStatusOK()
Returns if the status of the object is ok |
java.lang.String[] |
getURLAndFilename(URLParseObject upo)
Returns parsed URL and filename |
java.lang.String[] |
getURLAndFilename(URLParseObject upo,
OptionString pagesourcecode)
Returns parsed URL and filename |
java.lang.String |
getVersion()
Returns the version |
boolean |
isFromThisHoster(java.lang.String url,
Rule sourceRule)
Returns if this rule can parse the URL |
boolean |
isResend()
Returns if the URL must again be parsed by the HostManager |
boolean |
isUseContentDisposition()
Returns the useContentDisposition |
boolean |
removeDuplicateEqualsMethod(URL url1,
URL url2)
Method to compare to URLs for removing duplicate URLs Attention: This Method is called always when the equals-Method on an URL-Object is called. |
void |
setCustomReferrer(java.lang.String customReferrer)
Sets the customReferrer |
void |
setCustomReferrerDownload(java.lang.String customReferrerDownload)
Sets the customReferrerDownload |
void |
setDuplicateRemoveMode(int duplicateRemoveMode)
Sets the duplicateRemoveMode |
void |
setFile(java.io.File file)
Sets the path of the XML-File |
void |
setMaxConnectionDomains(java.util.Vector<java.lang.String> maxConnectionDomains)
Sets the maxConnectionDomains |
void |
setMaxConnections(int maxConnections)
Sets the maxConnections |
void |
setName(java.lang.String name)
Sets the name |
void |
setPattern(java.lang.String pattern)
Sets the Container-URL-Pattern |
void |
setReferrerMode(int referrerMode)
Sets the referrerMode |
void |
setReferrerModeDownload(int referrerModeDownload)
Sets the referrerModeDownload |
void |
setResend(boolean resend)
Sets the flag |
void |
setUseContentDisposition(boolean useContentDisposition)
Sets the useContentDisposition |
void |
setVersion(java.lang.String version)
Sets the version |
java.lang.String |
toString()
|
boolean |
writeRule()
Saves the rule to the XML-File |
| Methods inherited from class de.scheisseichfindemalkeinen.hoster.Hoster |
|---|
isDeveloper, setDeveloper |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int RULE_MODE_CONTAINER_OR_THUMBNAIL_URL
public static final int RULE_MODE_CONTAINER_PAGE_SOURCECODE
public static final int RULE_MODE_FILENAME
public static final int RULE_MODE_FILENAME_ON_DOWNLOAD_SELECTION
public static final int REFERRER_NO_REFERRER
public static final int REFERRER_LAST_CONTAINER_URL
public static final int REFERRER_FIRST_CONTAINER_URL
public static final int REFERRER_ORIGIN_PAGE
public static final int REFERRER_CUSTOM
public static final int DUPLICATES_BH_DEFAULT
public static final int DUPLICATES_CONTAINER_URL_ONLY
public static final int DUPLICATES_CONTAINER_URL_AND_THUMBNAIL_URL
public static final int DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITH_THUMB_THUMBS_ALWAYS_FIRST
public static final int DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITH_THUMB_THUMBS_ALWAYS_LAST
public static final int DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITHOUT_THUMB_THUMBS_ALWAYS_FIRST
public static final int DUPLICATES_CONTAINER_URL_ONLY_REMOVE_WITHOUT_THUMB_THUMBS_ALWAYS_LAST
public static org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public Rule(java.lang.String file)
file - Path to the XML-File
public Rule(java.lang.String name,
java.lang.String version,
int mode,
java.lang.String pattern,
java.lang.String file)
name - Nameversion - Versionmode - Modepattern - Container-URL-Patternfile - Path to the XML-File| Method Detail |
|---|
public boolean isFromThisHoster(java.lang.String url,
Rule sourceRule)
url - Container-URLsourceRule - Last rule which parsed the URL
public boolean getStatusOK()
public java.lang.String[] getURLAndFilename(URLParseObject upo)
throws HostException
upo - URLParseObject
HostException
public java.lang.String[] getURLAndFilename(URLParseObject upo,
OptionString pagesourcecode)
throws HostException
upo - URLParseObjectpagesourcecode - Container-Page-Source-Code
HostExceptionpublic java.lang.String getFilename(java.lang.String url)
url - URL
public boolean writeRule()
public java.lang.String getName()
public void setName(java.lang.String name)
name - Namepublic java.lang.String getVersion()
public void setVersion(java.lang.String version)
version - Versionpublic java.lang.String getPattern()
public void setPattern(java.lang.String pattern)
pattern - Container-URL-Patternpublic java.util.Vector<RulePipeline> getPipelines()
public RulePipeline getPipelineFilename()
public RulePipeline getPipelineFilenameDownloadSelection()
public java.io.File getFile()
public void setFile(java.io.File file)
file - Path of the XML-File
public static java.lang.String downloadContainerPage(java.lang.String url,
java.lang.String referrer)
throws HostException
url - Container-URLreferrer - Referrer
HostExceptionpublic boolean isResend()
public void setResend(boolean resend)
resend - Flag if the URL must again be parsed by the HostManagerpublic boolean isUseContentDisposition()
public void setUseContentDisposition(boolean useContentDisposition)
useContentDisposition - useContentDispositionpublic int getReferrerMode()
public void setReferrerMode(int referrerMode)
referrerMode - referrerModepublic int getReferrerModeDownload()
public void setReferrerModeDownload(int referrerModeDownload)
referrerModeDownload - referrerModeDownloadpublic java.lang.String getCustomReferrer()
public void setCustomReferrer(java.lang.String customReferrer)
customReferrer - customReferrerpublic java.lang.String getCustomReferrerDownload()
public void setCustomReferrerDownload(java.lang.String customReferrerDownload)
customReferrerDownload - customReferrerDownloadpublic int getMaxConnections()
public void setMaxConnections(int maxConnections)
maxConnections - maxConnectionspublic java.util.Vector<java.lang.String> getMaxConnectionDomains()
public void setMaxConnectionDomains(java.util.Vector<java.lang.String> maxConnectionDomains)
maxConnectionDomains - maxConnectionDomainspublic int getDuplicateRemoveMode()
public void setDuplicateRemoveMode(int duplicateRemoveMode)
duplicateRemoveMode - duplicateRemoveMode
public boolean removeDuplicateEqualsMethod(URL url1,
URL url2)
Hoster
removeDuplicateEqualsMethod in class Hosterurl1 - URLurl2 - URL
public java.lang.String toString()
toString in class Hoster
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||