
com.orientechnologies.common.io.OFileUtilsJava7 Maven / Gradle / Ivy
The newest version!
package com.orientechnologies.common.io;
import java.io.File;
import java.io.IOException;
import java.nio.file.*;
/**
* @author Andrey Lomakin Andrey Lomakin
* @since 7/22/14
*/
public class OFileUtilsJava7 {
public static boolean delete(File file) throws IOException {
if (!file.exists())
return true;
try {
final FileSystem fileSystem = FileSystems.getDefault();
final Path path = fileSystem.getPath(file.getAbsolutePath());
Files.delete(path);
return true;
} catch (FileSystemException e) {
return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy