Here you can find the source of delete(Path targetPath)
private static void delete(Path targetPath) throws IOException
//package com.java2s; /* FileUtils.java //from w w w . j av a 2 s.c o m * Copyright (c) 2012 by Brook Tran * All rights reserved. * * The copyright of this software is own by the authors. * You may not use, copy or modify this software, except * in accordance with the license agreement you entered into * with the copyright holders. For details see accompanying license * terms. */ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class Main { private static void delete(Path targetPath) throws IOException { Files.delete(targetPath); } }