Java Path Remove nio removeFile(String workspacePath)

Here you can find the source of removeFile(String workspacePath)

Description

remove File

License

Apache License

Declaration

public static void removeFile(String workspacePath) throws FileNotFoundException, IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void removeFile(String workspacePath) throws FileNotFoundException, IOException {
        Path path = FileSystems.getDefault().getPath(workspacePath);
        Files.delete(path);//from  w w  w .jav a  2 s .co m
    }
}

Related

  1. removeDirectory(String pathToDir)
  2. removeDirectoryIfItIsEmpty(Path directoryToRemove)
  3. removeDriveLetter(Path path)
  4. removeFile(final String removePath)
  5. removeFile(String path)
  6. removeLine(String path, String line, boolean commentAware)
  7. removeRecursive(Path path)
  8. removeRecursive(Path path)
  9. removeSymlink(Path softLinkLocation)