Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.File;

public class Main {

    private static boolean deleteFileSafely(File file) {
        if (file != null) {
            String tmpPath = file.getAbsolutePath() + System.currentTimeMillis();
            File tmp = new File(tmpPath);
            boolean result = file.renameTo(tmp);
            return result && tmp.delete();
        }
        return false;
    }
}