public class TempFileProvider extends Object
The contents of APPLICATION_TEMP_FILE_DIR [%java.io.tmpdir%/Gytheio] are managed by this class.
| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_LONG_LIFE_FILE_DIR
The prefix for the long life temporary files.
|
static String |
APPLICATION_TEMP_FILE_DIR
subdirectory in the temp directory where Gytheio temporary files will go
|
static String |
SYSTEM_KEY_TEMP_DIR
the system property key giving us the location of the temp directory
|
| Modifier | Constructor and Description |
|---|---|
protected |
TempFileProvider()
Static class only
|
| Modifier and Type | Method and Description |
|---|---|
static File |
createTempFile(InputStream in,
String namePrefix,
String nameSufix) |
static File |
createTempFile(String prefix,
String suffix)
Create a temp file in the alfresco temp dir.
|
static File |
createTempFile(String prefix,
String suffix,
File directory) |
protected static String |
getApplicationLongLifeFileDir()
Gets the longer life file directory
|
protected static String |
getApplicationTempFileDir()
Gets the temp file directory
|
static File |
getLongLifeTempDir(String key)
creates a longer living temp dir.
|
static File |
getSystemTempDir()
Get the Java Temp dir e.g.
|
static File |
getTempDir()
Get the Gytheio temp dir, by defaut %java.io.tempdir%/Gytheio.
|
static File |
getTempDir(String dirName)
Get the specified temp dir, %java.io.tempdir%/dirName.
|
protected static boolean |
isLongLifeTempDir(File file)
Is this a long life folder ?
|
public static final String APPLICATION_TEMP_FILE_DIR
public static final String APPLICATION_LONG_LIFE_FILE_DIR
public static final String SYSTEM_KEY_TEMP_DIR
public static File getSystemTempDir()
isDir == trueprotected static String getApplicationTempFileDir()
protected static String getApplicationLongLifeFileDir()
public static File getTempDir()
isDir == truepublic static File getTempDir(String dirName)
dirName - the name of sub-directory in %java.io.tempdir%isDir == truepublic static File createTempFile(InputStream in, String namePrefix, String nameSufix) throws Exception
Exceptionprotected static boolean isLongLifeTempDir(File file)
file - public static File createTempFile(String prefix, String suffix)
File that will be located in the
Gytheio subdirectory of the default temp directoryAPPLICATION_TEMP_FILE_DIR,
File.createTempFile(java.lang.String, java.lang.String)public static File createTempFile(String prefix, String suffix, File directory)
File that will be located in the
given directoryAPPLICATION_TEMP_FILE_DIR,
File.createTempFile(java.lang.String, java.lang.String)public static File getLongLifeTempDir(String key)
Code using the longer life temporary files should be careful to clean up since abuse of this feature may result in out of memory/disk space errors.
key - can be blank in which case the system will generate a folder to be used by all processes
or can be used to create a unique temporary folder name for a particular process. At the end of the process
the client can simply delete the entire temporary folder.Copyright © 2015 Alfresco Software. All rights reserved.