|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfacets.util.Tracer
facets.util.TextLines
public final class TextLines
Reads from and where allowed writes lines to a wrapped text file reference.
Can be constructed either from a File
or URL
;
read-only in the latter case.
Field Summary | |
---|---|
long |
chars
|
static java.lang.String |
DEFAULT_ENCODING
|
static java.lang.String |
encoding
[?Cp1252 Eclipse standard] US-ASCII Seven-bit ASCII, a.k.a. |
static java.lang.String |
EXT_CLEAR
|
static java.lang.String |
EXT_ZIP
|
long |
lines
|
java.lang.Object |
reference
|
static boolean |
trace
|
Constructor Summary | |
---|---|
TextLines(java.io.File file)
Wrap a file reference. |
|
TextLines(java.io.InputStream in)
Wrap an input stream. |
|
TextLines(java.io.OutputStream out)
Wrap an output stream. |
|
TextLines(java.net.URL url)
Wrap a URL reference. |
Method Summary | |
---|---|
void |
closeLineWriter()
|
void |
copyFile(java.lang.String outName)
|
static void |
createIfRequired(java.io.File file,
java.lang.String content)
|
java.lang.String |
getFileName()
|
boolean |
hasNextLine()
|
static TextLines |
newBuffer()
|
static TextLines |
newBuffer(java.lang.String[] lines)
|
java.io.InputStream |
newInputStream()
|
java.io.OutputStream |
newOutputStream()
|
java.io.BufferedReader |
newReader()
|
java.lang.String |
nextLine()
|
java.lang.String[] |
readLines()
|
java.lang.String |
readLinesString()
Attempts to read text lines from the reference or buffer wrapped. |
static void |
setDefaultEncoding(boolean systemAccess)
|
static void |
setEncoding(java.lang.String encoding)
|
java.lang.String |
toString()
|
protected void |
traceOutput(java.lang.String msg)
Outputs complete trace messages to console or elsewhere. |
void |
writeAllLines(java.lang.String[] lines)
Attempts to write text lines to the reference wrapped. |
void |
writeNextLine(java.lang.String line)
|
Methods inherited from class facets.util.Tracer |
---|
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutputWithClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_ENCODING
public static final java.lang.String EXT_ZIP
public static final java.lang.String EXT_CLEAR
public long lines
public long chars
public static java.lang.String encoding
[?Cp1252 Eclipse standard] US-ASCII Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set ISO-8859-1 ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1 UTF-8 Eight-bit UCS Transformation Format UTF-16BE Sixteen-bit UCS Transformation Format, big-endian byte order UTF-16LE Sixteen-bit UCS Transformation Format, little-endian byte order UTF-16 Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark
public static boolean trace
public final java.lang.Object reference
Constructor Detail |
---|
public TextLines(java.io.File file)
file
- must be non-null
public TextLines(java.net.URL url)
url
- must be non-null
public TextLines(java.io.OutputStream out)
out
- must be non-null
public TextLines(java.io.InputStream in)
in
- must be non-null
Method Detail |
---|
public java.lang.String getFileName()
protected void traceOutput(java.lang.String msg)
Tracer
Default prepends helpful classname to message.
traceOutput
in class Tracer
msg
- passed from one of the public
methodspublic void writeAllLines(java.lang.String[] lines) throws java.io.IOException
java.io.IOException
public void writeNextLine(java.lang.String line) throws java.io.IOException
java.io.IOException
public void closeLineWriter()
public java.io.OutputStream newOutputStream() throws java.io.IOException
java.io.IOException
public java.io.InputStream newInputStream() throws java.io.IOException
java.io.IOException
public boolean hasNextLine() throws java.io.IOException
java.io.IOException
public java.io.BufferedReader newReader() throws java.io.IOException
java.io.IOException
public java.lang.String nextLine() throws java.io.IOException
java.io.IOException
public java.lang.String[] readLines() throws java.io.IOException
java.io.IOException
public java.lang.String readLinesString() throws java.io.IOException
java.io.IOException
public static TextLines newBuffer()
public static TextLines newBuffer(java.lang.String[] lines)
public java.lang.String toString()
toString
in class java.lang.Object
public void copyFile(java.lang.String outName) throws java.io.IOException
java.io.IOException
public static void setDefaultEncoding(boolean systemAccess)
public static void setEncoding(java.lang.String encoding)
public static void createIfRequired(java.io.File file, java.lang.String content) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |