Example usage for java.nio.file.spi FileSystemProvider deleteIfExists

List of usage examples for java.nio.file.spi FileSystemProvider deleteIfExists

Introduction

In this page you can find the example usage for java.nio.file.spi FileSystemProvider deleteIfExists.

Prototype

public boolean deleteIfExists(Path path) throws IOException 

Source Link

Document

Deletes a file if it exists.

Usage

From source file:org.sakuli.AbstractLogAwareTest.java

public static void deleteFile(Path logFile) {
    FileSystemProvider provider = logFile.getFileSystem().provider();
    try {/*from  w  ww  .  ja v a2s  .  co  m*/
        provider.deleteIfExists(logFile);
    } catch (IOException e) {
        //do nothing
    }
}