A java.io.ByteArrayOutputStream
that throws an exception after writing
some bytes, if the given boudary (failAfter
) is surpased.
Exception that is thrown if the OS cannot/does not know how/is not able to open the respective file.
This function takes a Closeable
resource and a function r
that will
process the Closeable
resource.
This function takes a Closeable
resource and a function r
that will
process the Closeable
resource.
This function takes care of the correct handling of Closeable
resources.
When r
has finished processing the resource or throws an exception, the
resource is closed.
The Closeable
resource.
The function that processes the resource
.
If closable
is null
, null
is passed to r
.
This function takes a Source
object and a function r
that will
process the source.
This function takes a Source
object and a function r
that will
process the source.
This function takes care of the correct handling of resources.
When r
has finished processing the source or throws an exception,
the source is closed.
If source
is null
, null
is passed to r
.
A simple wrapper for java.nio.Files.write(Path,byte[])
.
Writes the given string (data
) to a temporary file using the given prefix and suffix.
Writes the given string (data
) to a temporary file using the given prefix and suffix.
Afterwards the system's native application that claims to be able to handle
files with the given suffix is opened. If this fails, the string is printed to
the console.
The string is always written using UTF-8 as the encoding.
A string the identifies the content of the file. (E.g., "ClassHierarchy" or "CHACallGraph")
The suffix of the file that identifies the used file format. (E.g., ".txt")
The name of the file if it was possible to write the file and open the native application.
Exemplary usage:
try { util.writeAndOpen("The Message", "Result", ".txt") } catch { case OpeningFileFailedException(file, _) ⇒ Console.err.println("Details can be found in: "+file.toString)
Writes the XML document to a temporary file and opens the file in the OS's default application.
Writes the XML document to a temporary file and opens the file in the OS's default application.
A string the identifies the content of the file. (E.g., "ClassHierarchy" or "CHACallGraph")
The suffix of the file that identifies the used file format. (E.g., ".xhtml")
The name of the file if it was possible to write the file and open the native application.
Various io-related helper methods and classes.
The implementations of the methods rely on Java NIO(2).