📄 logreader.html
字号:
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExpr(java.io.InputStreamReader, java.lang.String, int, boolean, int, int, long)">getByRegExpr</A></B>(java.io.InputStreamReader reader, java.lang.String regExpr, int addLines, boolean prependLineNumbers, int skipFirstMatches, int numberOfMatches, long logsize)</CODE><BR> Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExpr(java.io.InputStreamReader, java.lang.String, java.lang.String, boolean, int, int, long)">getByRegExpr</A></B>(java.io.InputStreamReader reader, java.lang.String regExpr, java.lang.String addLines, boolean prependLineNumbers, int skipFirstMatches, int numberOfMatches, long logsize)</CODE><BR> Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExpr(java.lang.String, java.lang.String, int, boolean, int, int)">getByRegExpr</A></B>(java.lang.String aFileName, java.lang.String regExpr, int addLines, boolean prependLineNumbers, int skipFirstMatches, int numberOfMatches)</CODE><BR> Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExpr(java.lang.String, java.lang.String, java.lang.String, boolean, int, int)">getByRegExpr</A></B>(java.lang.String aFileName, java.lang.String regExpr, java.lang.String addLines, boolean prependLineNumbers, int skipFirstMatches, int numberOfMatches)</CODE><BR> Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExprFromSeries(java.lang.String, java.lang.String, int, boolean, int, int)">getByRegExprFromSeries</A></B>(java.lang.String aFileName, java.lang.String regExpr, int addLines, boolean prependLineNumbers, int skipFirstMatches, int numberOfMatches)</CODE><BR> Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getByRegExprFromSeries(java.lang.String, java.lang.String, java.lang.String, boolean, int, int)">getByRegExprFromSeries</A></B>(java.lang.String aFileName, java.lang.String regExpr, java.lang.String addLines, boolean prependLineNumbers, int skipFirstMatches, int numberOfMatches)</CODE><BR> Returns all lines in a log/file matching a given regular expression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#getFromSeries(java.lang.String, int, int)">getFromSeries</A></B>(java.lang.String aFileName, int lineNumber, int n)</CODE><BR> Gets a portion of a log spread across a numbered series of files.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#tail(java.io.RandomAccessFile, int)">tail</A></B>(java.io.RandomAccessFile raf, int n)</CODE><BR> Implementation of a unix-like 'tail -n' command</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#tail(java.lang.String)">tail</A></B>(java.lang.String aFileName)</CODE><BR> Implementation of a unix-like 'tail' command</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/archive/crawler/util/LogReader.html#tail(java.lang.String, int)">tail</A></B>(java.lang.String aFileName, int n)</CODE><BR> Implementation of a unix-like 'tail -n' command</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="LogReader()"><!-- --></A><H3>LogReader</H3><PRE>public <B>LogReader</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="get(java.lang.String)"><!-- --></A><H3>get</H3><PRE>public static java.lang.String <B>get</B>(java.lang.String aFileName)</PRE><DL><DD>Returns the entire file. Useful for smaller files.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>aFileName</CODE> - a file name<DT><B>Returns:</B><DD>The String representation of the entire file. Null is returned if errors occur (file not found or io exception)</DL></DD></DL><HR><A NAME="get(java.io.InputStreamReader)"><!-- --></A><H3>get</H3><PRE>public static java.lang.String <B>get</B>(java.io.InputStreamReader reader)</PRE><DL><DD>Reads entire contents of reader, returns as string.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>reader</CODE> - <DT><B>Returns:</B><DD>String of entire contents; null for any error.</DL></DD></DL><HR><A NAME="get(java.lang.String, int, int)"><!-- --></A><H3>get</H3><PRE>public static java.lang.String[] <B>get</B>(java.lang.String aFileName, int lineNumber, int n)</PRE><DL><DD>Gets a portion of a log file. Starting at a given line number and the n-1 lines following that one or until the end of the log if that is reached first.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>aFileName</CODE> - The filename of the log/file<DD><CODE>lineNumber</CODE> - The number of the first line to get (if larger then the file an empty string will be returned)<DD><CODE>n</CODE> - How many lines to return (total, including the one indicated by lineNumber). If smaller then 1 then an empty string will be returned.<DT><B>Returns:</B><DD>An array of two strings is returned. At index 0 a portion of the file starting at lineNumber and reaching lineNumber+n is located. At index 1 there is an informational string about how large a segment of the file is being returned. Null is returned if errors occur (file not found or io exception)</DL></DD></DL><HR><A NAME="getFromSeries(java.lang.String, int, int)"><!-- --></A><H3>getFromSeries</H3><PRE>public static java.lang.String[] <B>getFromSeries</B>(java.lang.String aFileName, int lineNumber, int n)</PRE><DL><DD>Gets a portion of a log spread across a numbered series of files. Starting at a given line number and the n-1 lines following that one or until the end of the log if that is reached first.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>aFileName</CODE> - The filename of the log/file<DD><CODE>lineNumber</CODE> - The number of the first line to get (if larger then the file an empty string will be returned)<DD><CODE>n</CODE> - How many lines to return (total, including the one indicated by lineNumber). If smaller then 1 then an empty string will be returned.<DT><B>Returns:</B><DD>An array of two strings is returned. At index 0 a portion of the file starting at lineNumber and reaching lineNumber+n is located. At index 1 there is an informational string about how large a segment of the file is being returned. Null is returned if errors occur (file not found or io exception)</DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -