public class DataTempFileSwap extends Object implements DataSwap
A DataSwap implementation which uses temporary files for storing the
data.
File.createTempFile(String, String)| Constructor and Description |
|---|
DataTempFileSwap(String name)
Creates a swap.
|
DataTempFileSwap(String name,
String prefix,
String suffix)
Creates a swap.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
DataSource |
getSource()
Returns the source.
|
DataTarget |
getTarget()
Returns the target.
|
public DataTempFileSwap(String name)
Creates a swap.
name - The name of the target and source.IllegalArgumentException - If the name is null.public DataTempFileSwap(String name, String prefix, String suffix)
Creates a swap.
name - The name of the target and source.prefix - The prefix of the filename.suffix - The suffix of the filename.IllegalArgumentException - If any of the parameters are null.public DataTarget getTarget() throws IOException
DataSwapReturns the target.
Subsequent calls will return the same target.
getTarget in interface DataSwapIOException - If an I/O error occurs while creating the target.public DataSource getSource() throws IOException
DataSwapReturns the source.
Subsequent calls will return the same source.
getSource in interface DataSwapIOException - If an I/O error occurs while creating the source.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2015–2019. All rights reserved.