Java Delete Temp File deleteTempFile()

Here you can find the source of deleteTempFile()

Description

delete Temp File

License

BSD License

Declaration

public static void deleteTempFile() 

Method Source Code

//package com.java2s;
/*L//from www  .  java  2  s  .  c  om
 *  Copyright Washington University in St. Louis
 *  Copyright SemanticBits
 *  Copyright Persistent Systems
 *
 *  Distributed under the OSI-approved BSD 3-Clause License.
 *  See http://ncip.github.com/gsid/LICENSE.txt for details.
 */

import java.io.File;

public class Main {
    private static String fileName = "temp.txt";

    public static void deleteTempFile() {
        try {
            File f = new File(fileName);
            f.delete();
        } catch (Exception e) {

        }
    }
}

Related

  1. deleteTempFile(File f)
  2. deleteTempFile(final File tempFile)
  3. deleteTempFile(String fileId)
  4. deleteTempFiles()