Java File Touch touch(String name)

Here you can find the source of touch(String name)

Description

touch

License

Open Source License

Declaration

public static File touch(String name) throws IOException 

Method Source Code


//package com.java2s;
/*//from   w  w  w .j a v a  2  s .com
 * Copyright 2013 Qunar.com All right reserved. This software is the confidential and proprietary information of
 * Qunar.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into with Qunar.com.
 */

import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;

public class Main {
    public static File touch(String name) throws IOException {
        String tmpdir = System.getProperty("java.io.tmpdir");
        File tmpfile = new File(tmpdir, name);
        Files.touch(tmpfile);
        return tmpfile;
    }
}

Related

  1. touch(String file)
  2. touch(String file)
  3. touch(String fileName)
  4. touch(String filePath)
  5. touch(String fullFilePath)
  6. touchDir(String filePath)
  7. touchExisting(File file)
  8. touchFile(File directory, String name)
  9. touchFile(File file)