Creates an empty file and its intermediate directories if necessary.

@param filePath pathname string of the file to create
485819
public static void createFile(String filePath) throws IOException {
    Path storagePath = Paths.get(filePath);
    Files.createDirectories(storagePath.getParent());
    Files.createFile(storagePath);
  }
497829
private File withPath(Path path, File dir) {
        return new File(dir, path.getPath());
    }
619745
public static boolean isLegalFile(String filePath) {
        File file = new File(filePath);
        if (!file.exists() || file.isDirectory() || !file.canRead()) {
            return false;
        }
        return true;
    }
451610
static PathFileObject createSiblingPathFileObject(JavacPathFileManager fileManager,
            final Path path, final String relativePath) {
        return new PathFileObject(fileManager, path) {
            @Override
            String inferBinaryName(Iterable<? extends Path> paths) {
                return toBinaryName(relativePath, "/");
            }
        };
    }
767027
public static String createFolderPath(String path) {

        String[] pathParts = path.split("\\.");
        String path2 = "";
        for (String part : pathParts) {
            if (path2.equals("")) {
                path2 = part;
            } else {
                path2 = path2 + File.separator
                        + changeFirstLetterToLowerCase(createClassName(part));
            }
        }

        return path2;
    }
875912
final public function createFile($filePath = null)
    {
        if (isset($filePath)) {
            $this->filePath = $filePath;
        }

        if (pathinfo($this->filePath, PATHINFO_EXTENSION) === '') {
            $this->filePath .= $this->fileExtension;
        }

        return $this;
    }
249624
public static String verifyReadFile(String filePath){
		if (filePath==null){
			return "The path is null";
		} 

		File dir=new File(filePath);

		return verifyReadFile(dir);			
	}
903313
public static String generateOutputFilePath(String path, String fileName) {
		String tempPath = separatorsToSystem(path);
		tempPath = tempPath + File.separatorChar + fileName;
		return tempPath;
	}
708746
public function setFilepath(Path $filepath)
    {
        if ($this->filepath === null) {
            $this->filepath = $filepath;
        } else {
            $this->filepath->append($filepath);
        }
    }
599970
private static String getFilePath(String defaultPath, String filePath) {
		return defaultPath+File.separator+filePath;
	}
41072
private void initFileDirTables(Path path) throws IOException {
    FileStatus[] stats = fs.listStatus(path);
    if (stats != null) {
      for (FileStatus stat : stats) {
        if (stat.isDir()) {
          dirs.add(stat.getPath().toString());
          initFileDirTables(stat.getPath());
        } else {
          Path filePath = stat.getPath();
          if (filePath.getName().startsWith(StructureGenerator.FILE_NAME_PREFIX)) {
            files.add(filePath.toString());
          }
        }
      }
    }
  }
997472
def file_w_create_directories(filepath):
    
    dirname = os.path.dirname(filepath)

    if dirname and dirname != os.path.curdir and not os.path.isdir(dirname):
        os.makedirs(dirname)

    return open(filepath, 'w')
378560
public FSDataOutputStream create(Path f) throws IOException {
    return create(f, CreateOptions.writeOptions(true, null));
  }
1292432
public void addFile(String path, InputStream inputStream) throws IOException {
    addFile(path, inputStream, null);
  }
1334204
public static void createFileWithDefault(String filePath, long length) throws IOException {
    Path path = Paths.get(filePath);
    try {
      Files.deleteIfExists(path);
      try (
          RandomAccessFile randomAccessFile = new RandomAccessFile(filePath, "rw");
      ) {
        randomAccessFile.setLength(length);
      }
    } catch (IOException e) {
      throw new IOException("create spares file fail,path:" + filePath + " length:" + length, e);
    }
  }
46596
private synchronized void initialize(String fileName, String path) throws ParameterException {
		if(!path.equals(this.path)){
			checkPath(path);
			this.path = path;
		}
		if(!fileName.equals(this.fileName)){
			checkFileName(fileName);
			this.fileName = fileName;
		}
	}
758924
public JimfsPath createPath(@Nullable Name root, Iterable<Name> names) {
    ImmutableList<Name> nameList = ImmutableList.copyOf(Iterables.filter(names, NOT_EMPTY));
    if (root == null && nameList.isEmpty()) {
      // ensure the canonical empty path (one empty string name) is used rather than a path with
      // no root and no names
      return emptyPath();
    }
    return createPathInternal(root, nameList);
  }