public class OutputFileSpec
extends java.lang.Object
OutputFileSpec associates a File with a set of OpenOption to use when
opening the file for writing.| Constructor and Description |
|---|
OutputFileSpec(java.io.File pFile,
java.nio.file.OpenOption... pOpenOptions)
Create a new
OutputFileSpec. |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
getFile()
Get the file that will be opened in calls to
open(). |
java.io.OutputStream |
open()
Open the file for writing with the options specified in the constructor.
|
public OutputFileSpec(java.io.File pFile,
java.nio.file.OpenOption... pOpenOptions)
OutputFileSpec.pFile - The file specification.pOpenOptions - The options to specify when opening the file for writing.java.lang.NullPointerException - if any of the parameters is null.public java.io.File getFile()
open().File, never null.public java.io.OutputStream open()
throws java.io.IOException
OutputStream for the opened file. The caller is responsible for closing
this stream.java.io.IOException - if opening the file or creating a parent directory fails.