@Override protected String[] doListChildren() { try { if (!getType().hasChildren()) { return null; } } catch (FileSystemException e) { // should not happen as the type has already been cached. throw new RuntimeException(e); } return children.toArray(new String[children.size()]); }
@Override protected String[] doListChildren() { try { if (!getType().hasChildren()) { return null; } } catch (FileSystemException e) { // should not happen as the type has already been cached. throw new RuntimeException(e); } return children.toArray(new String[children.size()]); }
protected String getUriTrailer() { return getType().hasChildren() ? "/" : ""; }
/** * Lists the children of the file. */ @Override protected String[] doListChildren() { try { if (!getType().hasChildren()) { return null; } } catch (final FileSystemException e) { // should not happen as the type has already been cached. throw new RuntimeException(e); } return children.toArray(new String[children.size()]); }
protected String getUriTrailer() { return getType().hasChildren() ? "/" : ""; }
/** * Lists the children of the file. */ @Override protected String[] doListChildren() { try { if (!getType().hasChildren()) { return null; } } catch (final FileSystemException e) { // should not happen as the type has already been cached. throw new RuntimeException(e); } return children.toArray(new String[children.size()]); }
/** * Lists the children of the file. */ @Override protected String[] doListChildren() { try { if (!getType().hasChildren()) { return null; } } catch (final FileSystemException e) { // should not happen as the type has already been cached. throw new RuntimeException(e); } return children.toArray(new String[children.size()]); }
protected String getUriTrailer() { return getType().hasChildren() ? "/" : ""; }
protected String getUriTrailer() { return getType().hasChildren() ? "/" : ""; }
/** * Lists the children of the file. */ @Override protected String[] doListChildren() { try { if (!getType().hasChildren()) { return null; } } catch (final FileSystemException e) { // should not happen as the type has already been cached. throw new RuntimeException(e); } return children.toArray(new String[children.size()]); }
/** * Lists the children of the file. */ @Override protected String[] doListChildren() { try { if (!getType().hasChildren()) { return null; } } catch (final FileSystemException e) { // should not happen as the type has already been cached. throw new RuntimeException(e); } return children.toArray(new String[children.size()]); }
protected List<FileObject> listFiles(final FileObject file) { try { FileObject[] files = file.getType().hasChildren() ? file.getChildren() : null; return files != null ? Arrays.asList(files) : new ArrayList<FileObject>(); } catch (FileSystemException e) { throw new RuntimeException(e); } } }
private void resetChildrenList() { try { if (this.file.getType().hasChildren()) { this.children = new HashMap<>(); final FileObject[] childrenList = this.file.getChildren(); for (final FileObject element : childrenList) { this.children.put(element.getName(), new Object()); // null? } } } catch (final FileSystemException fse) { this.children = null; } }
private void resetChildrenList() { try { if (this.file.getType().hasChildren()) { this.children = new HashMap<>(); final FileObject[] childrenList = this.file.getChildren(); for (final FileObject element : childrenList) { this.children.put(element.getName(), new Object()); // null? } } } catch (final FileSystemException fse) { this.children = null; } }
private void resetChildrenList() { try { if (this.file.getType().hasChildren()) { this.children = new HashMap<>(); final FileObject[] childrenList = this.file.getChildren(); for (final FileObject element : childrenList) { this.children.put(element.getName(), new Object()); // null? } } } catch (final FileSystemException fse) { this.children = null; } }
/** * Remove a child. * * @param data The file data. * @throws FileSystemException if an error occurs. */ void removeChild(final RamFileData data) throws FileSystemException { if (!this.getType().hasChildren()) { throw new FileSystemException("A child can only be removed from a folder"); } if (!this.children.contains(data)) { throw new FileSystemException("Child not found. " + data); } this.children.remove(data); updateLastModified(); }
/** * Remove a child. * * @param data The file data. * @throws FileSystemException if an error occurs. */ void removeChild(final RamFileData data) throws FileSystemException { if (!this.getType().hasChildren()) { throw new FileSystemException("A child can only be removed from a folder"); } if (!this.children.contains(data)) { throw new FileSystemException("Child not found. " + data); } this.children.remove(data); updateLastModified(); }
private void assertEquals(final FileType expected, final FileType actualFileType) { Assert.assertEquals(expected.getName(), actualFileType.getName()); Assert.assertEquals(expected.hasAttributes(), actualFileType.hasAttributes()); Assert.assertEquals(expected.hasChildren(), actualFileType.hasChildren()); Assert.assertEquals(expected.hasContent(), actualFileType.hasContent()); } }
private void assertEquals(final FileType expected, final FileType actualFileType) { Assert.assertEquals(expected.getName(), actualFileType.getName()); Assert.assertEquals(expected.hasAttributes(), actualFileType.hasAttributes()); Assert.assertEquals(expected.hasChildren(), actualFileType.hasChildren()); Assert.assertEquals(expected.hasContent(), actualFileType.hasContent()); } }
private void assertEquals(final FileType expected, final FileType actualFileType) { Assert.assertEquals(expected.getName(), actualFileType.getName()); Assert.assertEquals(expected.hasAttributes(), actualFileType.hasAttributes()); Assert.assertEquals(expected.hasChildren(), actualFileType.hasChildren()); Assert.assertEquals(expected.hasContent(), actualFileType.hasContent()); } }