public FileObject[] getChildren() throws FileSystemException { return decoratedFileObject.getChildren(); }
public Collection<XStoreRecord> getChilden() { FileObject[] files; try { files = file.getChildren(); } catch (FileSystemException e) { throw new XStoreException(e); } List<XStoreRecord> children = new ArrayList<XStoreRecord>(files.length); for (FileObject file : files) { children.add(new XStoreRecordImpl(xstore, file)); } return children; }
protected FileObject[] doListChildrenResolved() throws Exception { if (this.fileInfo.isSymbolicLink()) { return getLinkDestination().getChildren(); } return null; }
public static boolean hasChildren(final FileObject file) throws FileSystemException { assert file != null; if (file.getType().hasChildren()) { FileObject[] children = file.getChildren(); if (children != null && children.length != 0) { return true; } } return false; }
/** * Lists the children of the file. */ protected String[] doListChildren() throws Exception { if (file != null) { final FileObject[] children = file.getChildren(); final String[] childNames = new String[children.length]; for (int i = 0; i < children.length; i++) { childNames[i] = children[i].getName().getBaseName(); } return childNames; } else { return (String[]) children.toArray(new String[children.size()]); } }
public static boolean hasChildren(final FileObject file) throws FileSystemException { assert file != null; if (file.getType().hasChildren()) { FileObject[] children = file.getChildren(); if (children != null && children.length != 0) { return true; } } return false; }
public static boolean hasChildren(final FileObject file) throws FileSystemException { assert file != null; if (file.getType().hasChildren()) { FileObject[] children = file.getChildren(); if (children != null && children.length != 0) { return true; } } return false; }
private void resetChildrenList() { try { if (this.file.getType().hasChildren()) { this.children = new HashMap(); FileObject[] childrenList = this.file.getChildren(); for (int i = 0; i < childrenList.length; i++) { this.children.put(childrenList[i].getName(), new Object()); // null? } } } catch (FileSystemException fse) { this.children = null; } }
for (FileObject child : file.getChildren()) { Command command = createCommand(child); commands.add(command);
protected void keep(FileObject remoteDir, Set<String> names) throws TinkException, IOException { for (FileObject child : remoteDir.getChildren()) { if (!names.contains(child.getName().getBaseName())) { child.delete(new AllFileSelector()); } } }
FileObject tarGZFile = fileSystemManager.resolveFile("tgz://" + input.getPath() + "/" + filename); FileObject[] children = tarGZFile.getChildren(); for (int i = 0; i < children.length; i++) { FileObject[] grandChildren = children[i].getChildren();
/** * Adds a file to be monitored. */ public void addFile(final FileObject file) { _addFile(file); try { // add all direct children too if (file.getType().hasChildren()) { // Traverse the children final FileObject[] children = file.getChildren(); for (int i = 0; i < children.length; i++) { _addFile(children[i]); } } } catch (FileSystemException fse) { log.error(fse.getLocalizedMessage(), fse); } }
/** * Get a list of direct descendents of the given resource. Note that attempts to get a list of * children does <emphasize>not</emphasize> result in an error. Instead an error message is * logged and an empty ArrayList returned. * * @return A <code>ArrayList</code> of VFSResources */ public List getChildren() { init(); ArrayList list = new ArrayList(); try { if ((resourceImpl != null) && resourceImpl.exists() && (resourceImpl.getType() == FileType.FOLDER)) { FileObject[] children = resourceImpl.getChildren(); for (int i = 0; i < children.length; i++) { FileObject child = children[i]; list.add(normalize(child.getName().getURI())); } } } catch (IOException e) { Message.debug(e); Message.verbose(e.getLocalizedMessage()); } return list; }
final FileObject[] children = file.getChildren(); for (int i = 0; i < children.length; i++)
final FileObject[] children = file.getChildren(); for (int i = 0; i < children.length; i++)
/** * Test if a directory is empty. {@inheritDoc} * @param dir Directory to check. * @return <code>true</code> if <code>dir</code> is empty, <code>false</code> otherwise. */ @Override public boolean isDirectoryEmpty(String dir) { boolean isEmpty; try { isEmpty = getFileSystemManager().resolveFile(dir).getChildren().length == 0; } catch (FileSystemException e) { throw new CargoException("Failed to find out if directory [" + dir + "] is empty.", e); } return isEmpty; }
/** * Return a listing of the contents of a parent directory. Listing is a set of strings * representing VFS URIs. * * @param vfsURI * providing identifying a VFS provided resource * @throws IOException * on failure. * @see "Supported File Systems in the jakarta-commons-vfs documentation" */ public List list(String vfsURI) throws IOException { ArrayList list = new ArrayList(); Message.debug("list called for URI" + vfsURI); FileObject resourceImpl = getVFSManager().resolveFile(vfsURI); Message.debug("resourceImpl=" + resourceImpl.toString()); Message.debug("resourceImpl.exists()" + resourceImpl.exists()); Message.debug("resourceImpl.getType()" + resourceImpl.getType()); Message.debug("FileType.FOLDER" + FileType.FOLDER); if ((resourceImpl != null) && resourceImpl.exists() && (resourceImpl.getType() == FileType.FOLDER)) { FileObject[] children = resourceImpl.getChildren(); for (int i = 0; i < children.length; i++) { FileObject child = children[i]; Message.debug("child " + i + child.getName().getURI()); list.add(VfsResource.normalize(child.getName().getURI())); } } return list; }
/** * Get the children of a directory. {@inheritDoc} * @param directory Directory to which to get the children. * @return Children of <code>directory</code>. */ @Override public String[] getChildren(String directory) { String[] results; try { FileObject[] files = getFileSystemManager().resolveFile(directory).getChildren(); results = new String[files.length]; for (int i = 0; i < files.length; i++) { results[i] = files[i].getName().getURI(); } } catch (FileSystemException e) { throw new CargoException("Failed to get childrens for [" + directory + "]", e); } return results; } }
FileObject[] newChildren = child.getChildren(); for (int i = 0; i < newChildren.length; i++)