Here you can find the source of removeFile(String workspacePath)
public static void removeFile(String workspacePath) throws FileNotFoundException, IOException
//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 } }