Java Path Delete nio delete(String targetFilePath)

Here you can find the source of delete(String targetFilePath)

Description

delete

License

Open Source License

Declaration

public static void delete(String targetFilePath) throws IOException 

Method Source Code

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

import java.io.IOException;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class Main {
    public static void delete(String targetFilePath) throws IOException {
        Path path = Paths.get(targetFilePath);
        Files.deleteIfExists(path);
    }//from w  w w .j  av a 2s  .  co m
}

Related

  1. delete(Path path)
  2. delete(Path root)
  3. delete(Path targetPath)
  4. delete(Path... paths)
  5. delete(String filePath, String fileName)
  6. deleteAllFilesRecursively(Path path)
  7. deleteContent(Path directory)
  8. deleteEmptyDirsUpTo(Path from, Path to)
  9. deleteEmptyParentDirs(Path pkgDirPath, Path repoPath)