public class FileTextIO extends Object
FileTextIO textIO = new FileTextIO().encodeAsUTF8(); textIO.read(...);
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected String |
_encoding
The encoding for the file.
|
protected boolean |
_removeUTF8Bom |
protected boolean |
_replaceCrLfToLf |
| コンストラクタと説明 |
|---|
FileTextIO() |
protected String _encoding
protected boolean _removeUTF8Bom
protected boolean _replaceCrLfToLf
public FileTextIO encodeAsUTF8()
public FileTextIO encodeAsWindows31J()
public FileTextIO removeUTF8Bom()
public FileTextIO replaceCrLfToLf()
public String read(InputStream ins)
ins - The input stream for the text. (NotNull)public String read(String textPath)
textPath - The path to the text file. (NotNull)public String readFilteringLine(String textPath, FileTextLineFilter oneArgLambda)
textPath - The path to the text file. (NotNull)oneArgLambda - The filter of text line. (NotNull)public String readFilteringLine(InputStream ins, FileTextLineFilter oneArgLambda)
ins - The input stream for the text. (NotNull)oneArgLambda - The filter of text line. (NotNull)public String readFilteringWhole(String textPath, FileTextWholeFilter oneArgLambda)
textPath - The path to the text file. (NotNull)oneArgLambda - The filter of whole text. (NotNull)public String readFilteringWhole(InputStream ins, FileTextWholeFilter oneArgLambda)
ins - The input stream for the text. (NotNull)oneArgLambda - The filter of whole text. (NotNull)public String rewriteFilteringLine(String textPath, FileTextLineFilter oneArgLambda)
textPath - The path to the text file. (NotNull)oneArgLambda - The filter of text line. (NotNull)public String rewriteFilteringLine(String textPath, FileTextWholeFilter oneArgLambda)
textPath - The path to the text file. (NotNull)oneArgLambda - The filter of whole text. (NotNull)public void write(OutputStream ous, String text)
ous - The output stream for the text. (NotNull)text - The written text. (NotNull)public void write(String textPath, String text)
textPath - The path to the text file. (NotNull)text - The written text. (NotNull)public String writeFilteringLine(String textPath, String text, FileTextLineFilter oneArgLambda)
textPath - The path to the text file. (NotNull)text - The written text. (NotNull)oneArgLambda - The filter of text line. (NotNull)public String writeFilteringLine(OutputStream ous, String text, FileTextLineFilter oneArgLambda)
ous - The output stream for the text. (NotNull)text - The written text. (NotNull)oneArgLambda - The filter of text line. (NotNull)public String writeFilteringLine(String textPath, String text, FileTextWholeFilter oneArgLambda)
textPath - The path to the text file. (NotNull)text - The written text. (NotNull)oneArgLambda - The filter of whole text. (NotNull)public String writeFilteringLine(OutputStream ous, String text, FileTextWholeFilter oneArgLambda)
ous - The output stream for the text. (NotNull)text - The written text. (NotNull)oneArgLambda - The filter of whole text. (NotNull)protected FileInputStream createFileInputStream(String textPath)
protected FileOutputStream createFileOutputStream(String textPath)
protected void mkdirsIfNeeds(String textPath)
protected byte[] readBytesClosed(InputStream ins) throws IOException
IOExceptionprotected String readTextClosed(InputStream ins) throws IOException
IOExceptionprotected void writeTextClosed(OutputStream ous, String text)
protected void close(BufferedReader reader)
protected void close(BufferedWriter writer)
protected void handleOutputStreamWriteFailureException(OutputStream ous, IOException e)
protected void handleTextFileWriteFailureException(String textPath, IOException e)
protected String handleInputStreamReadFailureException(InputStream ins, IOException e)
protected String handleTextFileReadFailureException(String textPath, IOException e)
protected String filterAsLine(String text, FileTextLineFilter filter)
protected String filterAsWhole(String text, FileTextWholeFilter filter)
protected void assertState()
protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, String value)
public void setEncoding(String encoding)
Copyright © 2014–2015 The DBFlute Project. All rights reserved.