org.scalatra.util.io
A collection of I/O utility methods.
Type members
Classlikes
Value members
Concrete methods
Copies the input stream to the output stream.
Copies the input stream to the output stream.
- Value parameters:
- bufferSize
the size of buffer to use for each read
- in
the input stream to read. The InputStream will be closed, unlike commons-io's version.
- out
the output stream to write
Executes a block with a closeable resource, and closes it after the block runs
Executes a block with a closeable resource, and closes it after the block runs
- Type parameters:
- A
the return type of the block
- B
the closeable resource type
- Value parameters:
- closeable
the closeable resource
- f
the block
Creates a temp file, passes it to a block, and removes the temp file on the block's completion.
Creates a temp file, passes it to a block, and removes the temp file on the block's completion.
- Type parameters:
- A
the return type of the block
- Value parameters:
- content
The content of the file
- directory
The directory of the temp file; a system dependent temp directory if None
- f
the block
- prefix
The prefix of the temp file; must be at least three characters long
- suffix
The suffix of the temp file
- Returns:
the result of f