Java File Touch touchFile(String target)

Here you can find the source of touchFile(String target)

Description

touch File

License

Open Source License

Declaration

public static void touchFile(String target) throws IOException 

Method Source Code


//package com.java2s;
//License from project: GNU General Public License 

import java.io.File;

import java.io.IOException;

import java.util.Date;

public class Main {
    public static void touchFile(String target) throws IOException {
        long now = new Date().getTime();
        new File(target).setLastModified(now);
    }/*from w  w w  .j  a  va2s . c o  m*/
}

Related

  1. touchDir(String filePath)
  2. touchExisting(File file)
  3. touchFile(File directory, String name)
  4. touchFile(File file)
  5. touchFile(File file)
  6. touchOrCrash(File f)
  7. touchRecursive(File f, long timestamp)