Java File Touch touch(File file)

Here you can find the source of touch(File file)

Description

Touch (update the modification time) the given file.

License

Open Source License

Parameter

Parameter Description
file The File to touch.

Declaration

public static void touch(File file) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    /**/* w  w w .j av a 2  s .c  om*/
     * Touch (update the modification time) the given file.
     *
     * @param file The {@link File} to touch.
     */
    public static void touch(File file) {
        file.setLastModified(System.currentTimeMillis());
    }
}

Related

  1. touch(File file)
  2. touch(File file)
  3. touch(File file)
  4. touch(File file)
  5. touch(File file)
  6. touch(File file, boolean createIfNeeded)
  7. touch(FileFilter filter, File root, boolean recurse)
  8. touch(final File f)
  9. touch(final File f)