Delete a file with Files and Paths : Files « JDK 7 « Java
- Java
- JDK 7
- Files
Delete a file with Files and Paths
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Test {
public static void main(String[] args) throws Exception{
Files.delete(Paths.get(new URI("file:///tmp.txt")));
}
}
Related examples in the same category