public class ContentUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static void |
closeInputStream(InputStream iss)
Close an InputStream, ignoring any exception.
|
static void |
closeOutputStream(OutputStream os)
Close an OutputStream, ignoring any exception.
|
static void |
closeReader(Reader reader)
Close an Reader, ignoring any exception.
|
static void |
closeWriter(Writer writer)
Close a Writer, ignoring any exception.
|
static String |
convertReaderToString(Reader reader)
Transfer content from a Reader into a String.
|
static void |
transferContent(InputStream iss,
OutputStream os)
Transfer content from an InputStream to an OutputStream.
|
static void |
writeDocumentContentToFile(Document doc,
String absFilename)
Write a Document's content to a local file, without append mode.
|
static void |
writeDocumentContentToFile(Document doc,
String absFilename,
boolean append)
Write a Document's content to a local file.
|
static void |
writeEmptyFile(String absFilename)
Write an empty file.
|
static void |
writeReaderContentToFile(Reader reader,
String absFilename)
Write a Reader's content to a local file, without append mode.
|
static void |
writeReaderContentToFile(Reader reader,
String absFilename,
boolean append)
Write a Reader's content to a local file.
|
static void |
writeStringContentToFile(String string,
String absFilename)
Write a String's value to a local file, without append mode.
|
static void |
writeStringContentToFile(String string,
String absFilename,
boolean append)
Write a String's value to a local file.
|
public static void writeDocumentContentToFile(Document doc, String absFilename) throws IfsException
doc
- the documentabsFilename
- the absolute file name for the local fileIfsException
- if the operation failspublic static void writeDocumentContentToFile(Document doc, String absFilename, boolean append) throws IfsException
doc
- the documentabsFilename
- the absolute file name for the local fileappend
- whether to append to the fileIfsException
- if the operation failspublic static void transferContent(InputStream iss, OutputStream os) throws IOException
iss
- Input streamos
- Output streamIOException
- if operation failspublic static void writeReaderContentToFile(Reader reader, String absFilename) throws IfsException
reader
- the ReaderabsFilename
- the absolute file name for the local fileIfsException
- if the operation failspublic static void writeReaderContentToFile(Reader reader, String absFilename, boolean append) throws IfsException
reader
- the ReaderabsFilename
- the absolute file name for the local fileappend
- whether to append to the fileIfsException
- if the operation failspublic static void writeStringContentToFile(String string, String absFilename) throws IfsException
string
- the StringabsFilename
- the absolute file name for the local fileIfsException
- if the operation failspublic static void writeStringContentToFile(String string, String absFilename, boolean append) throws IfsException
string
- the StringabsFilename
- the absolute file name for the local fileappend
- whether to append to the fileIfsException
- if the operation failspublic static void writeEmptyFile(String absFilename) throws IfsException
absFilename
- the absolute file name for the local fileIfsException
- if the operation failspublic static String convertReaderToString(Reader reader) throws IfsException
reader
- the readerIfsException
- if the operation failspublic static void closeInputStream(InputStream iss)
iss
- Input streampublic static void closeOutputStream(OutputStream os)
os
- Output streampublic static void closeReader(Reader reader)
reader
- the Readerpublic static void closeWriter(Writer writer)
writer
- the WriterCopyright © 2023. All rights reserved.