Create a new FileStatusEntry for the specified file.

@param parent The parent file entry
@param childPath The file to create an entry for
@return A new file entry
350777
private FileStatusEntry createPathEntry(final FileStatusEntry parent, final Path childPath)
      throws IOException {
    final FileStatusEntry entry = parent.newChildInstance(childPath);
    entry.refresh(childPath);
    final FileStatusEntry[] children = doListPathsEntry(childPath, entry);
    entry.setChildren(children);
    return entry;
  }
395622
private File createFile(ITestResult tr, File parentFolder) {

		String path;
				
		if (tr != null) { // tr is null only on tests purpose
			path = String.format("%s%c%s.png", parentFolder.getAbsolutePath(), File.separatorChar, tr.getName(), getDateSuffix());
		} else {
			path = String.format("%s%ctest_%d.png", parentFolder.getAbsolutePath(), File.separatorChar, System.currentTimeMillis());
		}
		
		return new File(path);
	}
1369605
private FileStatusEntry[] doListPathsEntry(Path path, FileStatusEntry entry)
      throws IOException {
    final Path[] paths = listPaths(path);

    final FileStatusEntry[] children =
        paths.length > 0 ? new FileStatusEntry[paths.length] : FileStatusEntry.EMPTY_ENTRIES;
    for (int i = 0; i < paths.length; i++) {
      children[i] = createPathEntry(entry, paths[i]);
    }
    return children;
  }
1092584
@Override
    public ICodeBaseLocator createNestedArchiveCodeBaseLocator(ICodeBase parentCodeBase, String path) {
        return new NestedZipFileCodeBaseLocator(parentCodeBase, path);
    }
922098
public static boolean isSubPath(File parent, File child) throws IOException {
    String childStr = child.getCanonicalPath();
    String parentStr = parent.getCanonicalPath();

    return childStr.startsWith(parentStr);
  }
356588
private static void joinPath(StringBuilder path, String parent, String child)
    {
        // Add parent piece, with no trailing slash.
        if ( (parent != null) && (parent.length() > 0) )
        {
            if ( !parent.startsWith(PATH_SEPARATOR) )
            {
                path.append(PATH_SEPARATOR);
            }
            if ( parent.endsWith(PATH_SEPARATOR) )
            {
                path.append(parent.substring(0, parent.length() - 1));
            }
            else
            {
                path.append(parent);
            }
        }

        if ( (child == null) || (child.length() == 0) || (child.equals(PATH_SEPARATOR)) )
        {
            // Special case, empty parent and child
            if ( path.length() == 0 )
            {
                path.append(PATH_SEPARATOR);
            }
            return;
        }

        // Now add the separator between parent and child.
        path.append(PATH_SEPARATOR);

        if ( child.startsWith(PATH_SEPARATOR) )
        {
            child = child.substring(1);
        }

        if ( child.endsWith(PATH_SEPARATOR) )
        {
            child = child.substring(0, child.length() - 1);
        }

        // Finally, add the child.
        path.append(child);
    }
300194
public static boolean isSubPath(org.apache.hadoop.fs.Path parent, org.apache.hadoop.fs.Path child) throws IOException {
    String childStr = child.toString();
    String parentStr = parent.toString();

    return childStr.startsWith(parentStr);
  }
108124
public static void mkParentDirs(final File file) throws IOException {
        // Create parent directory structure if necessary
        File parentFile = file.getParentFile();
        if (parentFile == null) {
            // File was created with a relative path
            parentFile = file.getAbsoluteFile().getParentFile();
        }
        if (parentFile != null && !parentFile.exists()) {
            if (!parentFile.mkdirs()) {
                throw new IOException("Unable to create parent directory " +
                        "structure for file " + file.getAbsolutePath());
            }
        }
    }
1061769
void openExplorerForParent(String rootPath, String uuid) {

        String parentPath = CmsResource.getParentFolder(rootPath);

        CmsAppWorkplaceUi.get().getNavigator().navigateTo(
            CmsFileExplorerConfiguration.APP_ID
                + "/"
                + A_CmsUI.getCmsObject().getRequestContext().getCurrentProject().getUuid()
                + "!!"
                + A_CmsUI.getCmsObject().getRequestContext().getSiteRoot()
                + "!!"
                + parentPath.substring(A_CmsUI.getCmsObject().getRequestContext().getSiteRoot().length())
                + "!!"
                + uuid
                + "!!");
    }
394257
public void setFilePath(String filePath)
    {
        //create a new file
        File fileInstance=null;
        if(filePath!=null)
        {
            fileInstance=new File(filePath);
        }
        
        //set file
        this.setFile(fileInstance);
    }
756585
public static boolean createNewFile(String filePath) {
        if (!StringUtils.isEmpty(filePath)) {
            File file = new File(filePath);
            return createNewFile(file);
        }
        return false;
    }
104088
def _AddParentDirectories(self, path):
    
    path_segments = self.file_system.SplitPath(path)
    for segment_index in range(len(path_segments)):
      parent_path = self.file_system.JoinPath(path_segments[:segment_index])
      file_entry = self.file_system.GetFileEntryByPath(parent_path)
      if file_entry and not file_entry.IsDirectory():
        raise ValueError(
            'Non-directory parent file entry: {0:s} already exists.'.format(
                parent_path))

    for segment_index in range(len(path_segments)):
      parent_path = self.file_system.JoinPath(path_segments[:segment_index])
      if not self.file_system.FileEntryExistsByPath(parent_path):
        self.file_system.AddFileEntry(
            parent_path, file_entry_type=definitions.FILE_ENTRY_TYPE_DIRECTORY)
371051
@Override
    public Resource createRelative(String relativePath) {
        String pathToUse = ResourceUtils.applyRelativePath(path, relativePath);
        return new FileSystemResource(pathToUse);
    }
297162
private void updateParentPath(String newParentPath, String oldParentPath) {

        String oldPath = getSitePath();
        String newPath = oldPath.replaceFirst(oldParentPath, newParentPath);
        getListItemWidget().setSubtitleLabel(newPath);
        for (Widget child : getChildren()) {
            ((CmsGalleryTreeItem)child).updateParentPath(newPath, oldPath);
        }
    }
267521
public static <A, E> ArrayPath<A, E> arrayPath(Class<A> arrayType, Path<?> parent, String property) {
        return new ArrayPath<A, E>(arrayType, parent, property);
    }
549038
@Override
    public boolean upload(String filePath) {
        WebLocator upload = new WebLocator(this).setTag("input").setType("file");
        return upload(upload, filePath);
    }
1064868
@Nonnull
  public File createDestinationFileForPath(@Nonnull final String path) {
    assertNotNull("Path is null", path);

    if (path.isEmpty()) {
      throw makeException("File name is empty", null);
    }

    return new File(this.getTarget(), path);
  }