Android Utililty Methods File Temp Create

List of utility methods to do File Temp Create

Description

The list of methods to do File Temp Create are organized into topic(s).

Method

FileaTempFile()
a Temp File
return removeableFile(tempFolder(), UUID.randomUUID().toString());
FilecreateTemp(File file)
Creates a temporary normal file.
try {
    Check.arg().notNull(file);
    if (file.exists()) {
        boolean deleted = file.delete();
        if (!deleted)
            throw new RuntimeException(
                    "file = "
                            + file.getPath()
...
FilecreateTemp(String path)
Returns #createTemp(File) createTemp ( new File(path) ).
Check.arg().notNull(path);
return createTemp(new File(path));
FilecreateTempFile()
create Temp File
return createFileInFolder(tempFolder(), UUID.randomUUID()
        .toString());
java.io.FilecreateTempFile(File baseDir, String fileName)
create Temp File
File tempFile = new File(baseDir, fileName);
tempFile.deleteOnExit();
return tempFile;
FilecreateTempFile(String filePrefix, String fileSuffix)
This wraps the standard create temp file and forces everything into the same baseDir.
return File.createTempFile(filePrefix, fileSuffix, baseDir);
FilecreateTempFile(String pFilename)
create Temp File
String lPrefix = TEMP_DIR_NAME + pFilename;
int lSuffix = 1;
String lFilename = lPrefix;
File lTempFile = null;
while ((lTempFile = new File(lFilename)).exists()) {
    lFilename = lPrefix + lSuffix++;
lTempFile.getParentFile().mkdirs();
...
FilegetTempFile()
get Temp File
return getTempFile("temp", ".tmp");
StringgetTempFile(String dir, String fileExt)
get Temp File
String tempFileName = CommUtil.formatDate("yyMMdd-HHmmssS",
        new Date()) + fileExt;
File file = new File(dir + "/" + tempFileName);
if (file.exists())
    return getTempFile(dir, fileExt);
else
    return tempFileName;
FilegetTempFile(String prefix, String suffix)
get Temp File
File file = null;
try {
    file = File.createTempFile(prefix, suffix, getApp()
            .getApplicationContext().getExternalCacheDir());
    myTempFiles.add(file);
} catch (Exception e) {
return file;
...