/** * Returns a child of this file. * * @param name The name of the child to locate. * @return The FileObject for the file or null if the child does not exist. * @throws FileSystemException if an error occurs. */ @Override public FileObject getChild(final String name) throws FileSystemException { // TODO - use a hashtable when there are a large number of children final FileObject[] children = getChildren(); for (final FileObject element : children) { final FileName child = element.getName(); // TODO - use a comparator to compare names if (child.getBaseName().equals(name)) { return resolveFile(child); } } return null; }
/** * Returns a child of this file. * * @param name The name of the child to locate. * @return The FileObject for the file or null if the child does not exist. * @throws FileSystemException if an error occurs. */ @Override public FileObject getChild(final String name) throws FileSystemException { // TODO - use a hashtable when there are a large number of children final FileObject[] children = getChildren(); for (final FileObject element : children) { final FileName child = element.getName(); // TODO - use a comparator to compare names if (child.getBaseName().equals(name)) { return resolveFile(child); } } return null; }
/** * Returns a child of this file. * * @param name The name of the child to locate. * @return The FileObject for the file or null if the child does not exist. * @throws FileSystemException if an error occurs. */ @Override public FileObject getChild(final String name) throws FileSystemException { // TODO - use a hashtable when there are a large number of children final FileObject[] children = getChildren(); for (final FileObject element : children) { final FileName child = element.getName(); // TODO - use a comparator to compare names if (child.getBaseName().equals(name)) { return resolveFile(child); } } return null; }
/** * Returns a child of this file. * @param name The name of the child to locate. * @return The FileObject for the file or null if the child does not exist. * @throws FileSystemException if an error occurs. */ @Override public FileObject getChild(final String name) throws FileSystemException { // TODO - use a hashtable when there are a large number of children final FileObject[] children = getChildren(); for (final FileObject element : children) { final FileName child = element.getName(); // TODO - use a comparator to compare names if (child.getBaseName().equals(name)) { return resolveFile(child); } } return null; }
if (file.getType().hasChildren() && file.getChildren().length != 0) {
if (file.getType().hasChildren() && file.getChildren().length != 0) {
if (file.getType().hasChildren() && file.getChildren().length != 0) {
/** * Returns the file's list of children. * * @return The list of children * @throws FileSystemException If there was a problem listing children * @see AbstractFileObject#getChildren() * @since 2.0 */ @Override public FileObject[] getChildren() throws FileSystemException { try { if (doGetType() != FileType.FOLDER) { throw new FileNotFolderException(getName()); } } catch (final Exception ex) { throw new FileNotFolderException(getName(), ex); } try { /* * Wrap our parent implementation, noting that we're refreshing so that we don't refresh() ourselves and * each of our parents for each children. Note that refresh() will list children. Meaning, if if this file * has C children, P parents, there will be (C * P) listings made with (C * (P + 1)) refreshes, when there * should really only be 1 listing and C refreshes. */ this.inRefresh.set(true); return super.getChildren(); } finally { this.inRefresh.set(false); } }
if (file.getType().hasChildren() && file.getChildren().length != 0)
/** * Returns the file's list of children. * * @return The list of children * @throws FileSystemException If there was a problem listing children * @see AbstractFileObject#getChildren() * @since 2.0 */ @Override public FileObject[] getChildren() throws FileSystemException { try { if (doGetType() != FileType.FOLDER) { throw new FileNotFolderException(getName()); } } catch (final Exception ex) { throw new FileNotFolderException(getName(), ex); } try { /* * Wrap our parent implementation, noting that we're refreshing so that we don't refresh() ourselves and * each of our parents for each children. Note that refresh() will list children. Meaning, if if this file * has C children, P parents, there will be (C * P) listings made with (C * (P + 1)) refreshes, when there * should really only be 1 listing and C refreshes. */ this.inRefresh = true; return super.getChildren(); } finally { this.inRefresh = false; } }
/** * Returns the file's list of children. * * @return The list of children * @throws FileSystemException If there was a problem listing children * @see AbstractFileObject#getChildren() * @since 2.0 */ @Override public FileObject[] getChildren() throws FileSystemException { try { if (doGetType() != FileType.FOLDER) { throw new FileNotFolderException(getName()); } } catch (final Exception ex) { throw new FileNotFolderException(getName(), ex); } try { /* * Wrap our parent implementation, noting that we're refreshing so that we don't refresh() ourselves and * each of our parents for each children. Note that refresh() will list children. Meaning, if if this file * has C children, P parents, there will be (C * P) listings made with (C * (P + 1)) refreshes, when there * should really only be 1 listing and C refreshes. */ this.inRefresh = true; return super.getChildren(); } finally { this.inRefresh = false; } }
return super.getChildren();