Java Delete Temp File deleteTempFile(String fileId)

Here you can find the source of deleteTempFile(String fileId)

Description

delete Temp File

License

Open Source License

Declaration

public static void deleteTempFile(String fileId) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {
    public static void deleteTempFile(String fileId) {
        File tempFile = new File(getTempDirectory(), fileId);
        if (tempFile.exists()) {
            tempFile.delete();//w ww .j  ava2s  . c o  m
        }
    }

    private static File getTempDirectory() {
        return new File(System.getProperty("java.io.tmpdir"));
    }
}

Related

  1. deleteTempFile()
  2. deleteTempFile(File f)
  3. deleteTempFile(final File tempFile)
  4. deleteTempFiles()
  5. deleteTempFiles()
  6. deleteTempFiles()
  7. deleteTempFiles()