Java File Delete clearFile(File file)

Here you can find the source of clearFile(File file)

Description

clear File

License

Open Source License

Declaration

public static void clearFile(File file) throws IOException 

Method Source Code


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

import java.io.File;
import java.io.IOException;

public class Main {
    public static void clearFile(File file) throws IOException {
        file.delete();/*from   w  ww. ja v a2 s.  c  om*/

        file.createNewFile();
    }
}

Related

  1. clearFile(String directory)
  2. clearFile(String pFileName)
  3. clearFileOrDir(File file)
  4. delete(File aFile)