public final class TempFileProvider extends Object implements Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this provider and delete any temp files associated with it.
|
static TempFileProvider |
create(String providerType,
ScheduledExecutorService executor)
Create a temporary file provider for a given type.
|
static TempFileProvider |
create(String providerType,
ScheduledExecutorService executor,
boolean cleanExisting)
Create a temporary file provider for a given type.
|
TempDir |
createTempDir(String originalName)
Create a temp directory, into which temporary files may be placed.
|
protected void |
finalize() |
public static TempFileProvider create(String providerType, ScheduledExecutorService executor) throws IOException
create(final String providerType, final ScheduledExecutorService executor, false)providerType - the provider type string (used as a prefix in the temp file dir name)executor - the executorIOException - if an I/O error occurspublic static TempFileProvider create(String providerType, ScheduledExecutorService executor, boolean cleanExisting) throws IOException
providerType - The provider type string (used as a prefix in the temp file dir name)executor - Executor which will be used to manage temp file provider tasks (like cleaning up/deleting the temp files when needed)cleanExisting - If this is true, then existing temp content (if any) for the providerType will be deleted and the implementation ensures that when this method returns, the
returned TempFileProvider can be used and the previously existing content (if any) for this providerType will not be present under the root directory
represented by the returned TempFileProviderIOException - if an I/O error occurspublic TempDir createTempDir(String originalName) throws IOException
originalName - the original file nameIOException - for any errorpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2013 JBoss, A division of Red Hat, Inc. All Rights Reserved.