org.mashupbots.socko.infrastructure
Returns a newly created temporary directory in the system defined temporary directory
Returns a newly created temporary directory in the system defined temporary directory
Prefix to use on the directory name
Newly created directory
Delete the specified directory and all sub directories
Delete the specified directory and all sub directories
Directory to delete
Delete all the contents (files and sub-directories) of the specified directory
Delete all the contents (files and sub-directories) of the specified directory
Directory
Tests if a path string is an absolute path or not
Tests if a path string is an absolute path or not
Assumes that an absolute path starts with the file separator of if on windows, it starts with a drive letter.
Pipe input to output stream using 8K blocks
Pipe input to output stream using 8K blocks
Input stream
Output stream
Returns the contents of a file as bytes.
Returns the contents of a file as bytes. Throws FileNotFoundException
if the file is not found.
File to read
Returns the contents of a file as bytes.
Returns the contents of a file as bytes. Throws FileNotFoundException
if the file is not found.
Full path to file to read
Read bytes from an input stream.
Read bytes from an input stream. The input stream will be closed by this method after reading
Input stream
Returns the contents of a resource as bytes; null
if the resource was not found.
Returns the contents of a resource as bytes; null
if the resource was not found.
Class path of the resource in the classpath. Do **NOT** put a leading "/". See article
Auto close streams with automatic resource management
Auto close streams with automatic resource management
Also see Programming in Scala Second Edition Chapter 20.8.
Example usage
using(new BufferedReader(new FileReader("file"))) { r => var count = 0 while (r.readLine != null) count += 1 println(count) }
Write a text file
Write a text file
File to write to. If the file exists, it will be overwritten
Text to write to the file
Character set. Defaults to UTF-8.
file
Utility IO methods