Android File Create createFile(String path)

Here you can find the source of createFile(String path)

Description

Procedure for creating a File

Declaration

public static File createFile(String path) 

Method Source Code

//package com.java2s;

import java.io.File;

import java.io.IOException;

public class Main {
    /** Procedure for creating a File */
    public static File createFile(String path) {
        File file = new File(path);
        if (!file.exists()) {
            try {
                file.createNewFile();/*from   ww  w.  j a v a2 s  . c om*/
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return file;
    }
}

Related

  1. createFile(File file, boolean isFile)
  2. createFile(String file, String content, String encodType)
  3. createFile(String fileName)
  4. createFile(String fileName)
  5. createFile(String filePathAndName, String fileContent)
  6. createFile(String path)
  7. createFile(String path, List content)
  8. createFile(String path, String content)
  9. createFile(String path, boolean isFile)