Java File Touch touch(String fullFilePath)

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

Description

touch

License

Apache License

Declaration

public static File touch(String fullFilePath) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {

    public static File touch(String fullFilePath) throws IOException {
        if (fullFilePath == null) {
            return null;
        }/*w w w  .j  ava  2  s .c o  m*/
        File file = new File(fullFilePath);

        file.getParentFile().mkdirs();
        if (!file.exists())
            file.createNewFile();
        return file;
    }
}

Related

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