重新抛出Java中的异常
/* from 时代Java - N o w J a v a . c o m*/ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.nio.file.DirectoryNotEmptyException; import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static void main(String[] args) { try { deleteFile(Paths.get(new URI("file:///tmp.txt"))); } catch (URISyntaxException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } }/**NowJava.com - 时 代 Java**/ private static void deleteFile(Path path) throws NoSuchFileException, DirectoryNotEmptyException { try { Files.delete(path); } catch (IOException ex) { if (path.toFile().isDirectory()) {