Example usage for com.google.common.base Files touch

List of usage examples for com.google.common.base Files touch

Introduction

In this page you can find the example usage for com.google.common.base Files touch.

Prototype

public static void touch(File file) throws IOException 

Source Link

Document

Creates an empty file or updates the last updated timestamp on the same as the unix command of the same name.

Usage

From source file:de.martido.genny.codegen.AbstractSourceFileGenerator.java

/**
 * Creates the actual source file and, if necessary, all parent directories.
 * /* w  ww  . ja va  2  s.com*/
 * @param sourceFile
 *          <i>mandatory</i> - the {@link SourceFile}.
 * @return A {@code File}.
 * @throws IOException
 *           If an I/O error occured.
 */
protected File createFile(SourceFile sourceFile) throws IOException {
    File file = new File(sourceFile.asPath());
    Files.createParentDirs(file);
    Files.touch(file);
    return file;
}