📄 heritrix.html
字号:
<A NAME="getHeritrixHome()"><!-- --></A><H3>getHeritrixHome</H3><PRE>protected static java.io.File <B>getHeritrixHome</B>() throws java.io.IOException</PRE><DL><DD>Exploit <code>-Dheritrix.home</code> if available to us. Is current working dir if no heritrix.home property supplied.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>Heritrix home directory.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL></DD></DL><HR><A NAME="getJobsdir()"><!-- --></A><H3>getJobsdir</H3><PRE>public static java.io.File <B>getJobsdir</B>() throws java.io.IOException</PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The directory into which we put jobs. If the system property 'heritrix.jobsdir' is set, we will use its value in place of the default 'jobs' directory in the current working directory.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL></DD></DL><HR><A NAME="getSubDir(java.lang.String)"><!-- --></A><H3>getSubDir</H3><PRE>protected static java.io.File <B>getSubDir</B>(java.lang.String subdirName) throws java.io.IOException</PRE><DL><DD>Get and check for existence of expected subdir. If development flag set, then look for dir under src dir.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>subdirName</CODE> - Dir to look for.<DT><B>Returns:</B><DD>The extant subdir. Otherwise null if we're running in a webapp context where there is no conf directory available.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if unable to find expected subdir.</DL></DD></DL><HR><A NAME="getSubDir(java.lang.String, boolean)"><!-- --></A><H3>getSubDir</H3><PRE>protected static java.io.File <B>getSubDir</B>(java.lang.String subdirName, boolean fail) throws java.io.IOException</PRE><DL><DD>Get and optionally check for existence of subdir. If development flag set, then look for dir under src dir.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>subdirName</CODE> - Dir to look for.<DD><CODE>fail</CODE> - True if we are to fail if directory does not exist; false if we are to return false if the directory does not exist.<DT><B>Returns:</B><DD>The extant subdir. Otherwise null if we're running in a webapp context where there is no subdir directory available.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if unable to find expected subdir.</DL></DD></DL><HR><A NAME="isValidLoginPasswordString(java.lang.String)"><!-- --></A><H3>isValidLoginPasswordString</H3><PRE>protected static boolean <B>isValidLoginPasswordString</B>(java.lang.String str)</PRE><DL><DD>Test string is valid login/password string. A valid login/password string has the login and password compounded w/ a ':' delimiter.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>str</CODE> - String to test.<DT><B>Returns:</B><DD>True if valid password/login string.</DL></DD></DL><HR><A NAME="isDevelopment()"><!-- --></A><H3>isDevelopment</H3><PRE>protected static boolean <B>isDevelopment</B>()</PRE><DL><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="loadProperties()"><!-- --></A><H3>loadProperties</H3><PRE>protected static java.util.Properties <B>loadProperties</B>() throws java.io.IOException</PRE><DL><DD>Load the heritrix.properties file. Adds any property that starts with <code>HERITRIX_PROPERTIES_PREFIX</code> or <code>ARCHIVE_PACKAGE</code> into system properties (except logging '.level' directives).<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>Loaded properties.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL></DD></DL><HR><A NAME="getPropertiesInputStream()"><!-- --></A><H3>getPropertiesInputStream</H3><PRE>protected static java.io.InputStream <B>getPropertiesInputStream</B>() throws java.io.IOException</PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL></DD></DL><HR><A NAME="patchLogging()"><!-- --></A><H3>patchLogging</H3><PRE>protected static void <B>patchLogging</B>() throws java.lang.SecurityException, java.io.IOException</PRE><DL><DD>If the user hasn't altered the default logging parameters, tighten them up somewhat: some of our libraries are way too verbose at the INFO or WARNING levels. This might be a problem running inside in someone else's container. Container's seem to prefer commons logging so we ain't messing them doing the below.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE><DD><CODE>java.lang.SecurityException</CODE></DL></DD></DL><HR><A NAME="configureTrustStore()"><!-- --></A><H3>configureTrustStore</H3><PRE>protected static void <B>configureTrustStore</B>()</PRE><DL><DD>Configure our trust store. If system property is defined, then use it for our truststore. Otherwise use the heritrix truststore under conf directory if it exists. <p>If we're not launched from the command-line, we will not be able to find our truststore. The truststore is nor normally used so rare should this be a problem (In case where we don't use find our trust store, we'll use the 'default' -- either the JVMs or the containers).<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="selftest(java.lang.String, int)"><!-- --></A><H3>selftest</H3><PRE>protected static java.lang.String <B>selftest</B>(java.lang.String oneSelfTestName, int port) throws java.lang.Exception</PRE><DL><DD>Run the selftest<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>oneSelfTestName</CODE> - Name of a test if we are to run one only rather than the default running all tests.<DD><CODE>port</CODE> - Port number to use for web UI.<DT><B>Returns:</B><DD>Status of how selftest startup went.<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE></DL></DD></DL><HR><A NAME="doOneCrawl(java.lang.String)"><!-- --></A><H3>doOneCrawl</H3><PRE>protected java.lang.String <B>doOneCrawl</B>(java.lang.String crawlOrderFile) throws <A HREF="../../../org/archive/crawler/framework/exceptions/InitializationException.html" title="class in org.archive.crawler.framework.exceptions">InitializationException</A>, javax.management.InvalidAttributeValueException</PRE><DL><DD>Launch the crawler without a web UI and run the passed crawl only. Specialized version of <A HREF="../../../org/archive/crawler/Heritrix.html#launch()"><CODE>launch()</CODE></A>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>crawlOrderFile</CODE> - The crawl order to crawl.<DT><B>Returns:</B><DD>Status string.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/archive/crawler/framework/exceptions/InitializationException.html" title="class in org.archive.crawler.framework.exceptions">InitializationException</A></CODE><DD><CODE>javax.management.InvalidAttributeValueException</CODE></DL></DD></DL><HR><A NAME="doOneCrawl(java.lang.String, org.archive.crawler.event.CrawlStatusListener)"><!-- --></A><H3>doOneCrawl</H3><PRE>protected java.lang.String <B>doOneCrawl</B>(java.lang.String crawlOrderFile, <A HREF="../../../org/archive/crawler/event/CrawlStatusListener.html" title="interface in org.archive.crawler.event">CrawlStatusListener</A> listener) throws <A HREF="../../../org/archive/crawler/framework/exceptions/InitializationException.html" title="class in org.archive.crawler.framework.exceptions">InitializationException</A>, javax.management.InvalidAttributeValueException</PRE><DL><DD>Launch the crawler without a web UI and run passed crawl only. Specialized version of <A HREF="../../../org/archive/crawler/Heritrix.html#launch()"><CODE>launch()</CODE></A>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>crawlOrderFile</CODE> - The crawl order to crawl.<DD><CODE>listener</CODE> - Register this crawl status listener before starting crawl (You can use this listener to notice end-of-crawl).<DT><B>Returns:</B><DD>Status string.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/archive/crawler/framework/exceptions/InitializationException.html" title="class in org.archive.crawler.framework.exceptions">InitializationException</A></CODE><DD><CODE>javax.management.InvalidAttributeValueException</CODE></DL></DD></DL><HR><A NAME="launch()"><!-- --></A><H3>launch</H3><PRE>public java.lang.String <B>launch</B>() throws java.lang.Exception</PRE><DL><DD>Launch the crawler for a web UI. Crawler hangs around waiting on jobs.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -