guava/src/com/google/common/io/Files.java
@Beta
  @SuppressWarnings("GoodTime") // reading system time without TimeSource
  public static void touch(File file) throws IOException {
    checkNotNull(file);
    if (!file.createNewFile() && !file.setLastModified(System.currentTimeMillis())) {
      throw new IOException("Unable to update modification time of " + file);
    }
  }
@Beta
  @SuppressWarnings("GoodTime") // reading system time without TimeSource
  public static void touch(File file) throws IOException {
    checkNotNull(file);
    if (!file.createNewFile() && !file.setLastModified(System.currentTimeMillis())) {
      throw new IOException("Unable to update modification time of " + file);
    }
  }
@ Beta @ SuppressWarnings ( "GoodTime" ) // reading system time without TimeSource public static void touch ( File file ) throws IOException { checkNotNull ( file ) ; if ( ! file . createNewFile ( ) && ! file . setLastModified ( System . currentTimeMillis ( ) ) ) { throw new IOException ( "Unable to update modification time of " + file ) ; } }
Creates an empty file or updates the last updated timestamp on the same as the unix command of
the same name.

@param file the file to create or update
@throws IOException if an I/O error occurs
Creates an empty file or updates the last updated timestamp on the same as the unix command of the same name .