@Override public int hashCode() { return this.getName().hashCode(); }
@Override public int hashCode() { return this.getName().hashCode(); }
@Override public int hashCode() { return this.getName().hashCode(); }
@Override public int hashCode() { return this.getName().hashCode(); }
/** * @param name The name of the file. * @return children The names of the children. */ String[] listChildren(final FileName name) { final RamFileData data = this.cache.get(name); if (data == null || !data.getType().hasChildren()) { return null; } final Collection<RamFileData> children = data.getChildren(); String[] names; synchronized (children) { names = new String[children.size()]; int pos = 0; final Iterator<RamFileData> iter = children.iterator(); while (iter.hasNext()) { final RamFileData childData = iter.next(); names[pos] = childData.getName().getBaseName(); pos++; } } return names; }
/** * @param name The name of the file. * @return children The names of the children. */ String[] listChildren(final FileName name) { final RamFileData data = this.cache.get(name); if (data == null || !data.getType().hasChildren()) { return null; } final Collection<RamFileData> children = data.getChildren(); String[] names; synchronized (children) { names = new String[children.size()]; int pos = 0; final Iterator<RamFileData> iter = children.iterator(); while (iter.hasNext()) { final RamFileData childData = iter.next(); names[pos] = childData.getName().getBaseName(); pos++; } } return names; }
/** * @param name The name of the file. * @return children The names of the children. */ String[] listChildren(final FileName name) { final RamFileData data = this.cache.get(name); if (data == null || !data.getType().hasChildren()) { return null; } final Collection<RamFileData> children = data.getChildren(); String[] names; synchronized (children) { names = new String[children.size()]; int pos = 0; final Iterator<RamFileData> iter = children.iterator(); while (iter.hasNext()) { final RamFileData childData = iter.next(); names[pos] = childData.getName().getBaseName(); pos++; } } return names; }
/** * @param name The name of the file. * @return children The names of the children. */ String[] listChildren(final FileName name) { final RamFileData data = this.cache.get(name); if (data == null || !data.getType().hasChildren()) { return null; } final Collection<RamFileData> children = data.getChildren(); String[] names; synchronized (children) { names = new String[children.size()]; int pos = 0; final Iterator<RamFileData> iter = children.iterator(); while (iter.hasNext()) { final RamFileData childData = iter.next(); names[pos] = childData.getName().getBaseName(); pos++; } } return names; }
/** * Saves a file * * @param file * @throws FileSystemException */ void save(final RamFileObject file) throws FileSystemException { // Validate name if (file.getData().getName() == null) { throw new FileSystemException(new IllegalStateException("The data has no name. " + file)); } // Add to the parent if (file.getName().getDepth() > 0) { final RamFileData parentData = this.cache.get(file.getParent().getName()); // Only if not already added if (!parentData.hasChildren(file.getData())) { final RamFileObject parent = (RamFileObject) file.getParent(); parent.getData().addChild(file.getData()); parent.close(); } } // Store in cache cache.put(file.getName(), file.getData()); file.getData().updateLastModified(); file.close(); }
/** * Saves a file * * @param file * @throws FileSystemException */ void save(final RamFileObject file) throws FileSystemException { // Validate name if (file.getData().getName() == null) { throw new FileSystemException(new IllegalStateException("The data has no name. " + file)); } // Add to the parent if (file.getName().getDepth() > 0) { final RamFileData parentData = this.cache.get(file.getParent().getName()); // Only if not already added if (!parentData.hasChildren(file.getData())) { final RamFileObject parent = (RamFileObject) file.getParent(); parent.getData().addChild(file.getData()); parent.close(); } } // Store in cache cache.put(file.getName(), file.getData()); file.getData().updateLastModified(); file.close(); }
/** * Saves a file * * @param file * @throws FileSystemException */ void save(final RamFileObject file) throws FileSystemException { // Validate name if (file.getData().getName() == null) { throw new FileSystemException(new IllegalStateException("The data has no name. " + file)); } // Add to the parent if (file.getName().getDepth() > 0) { final RamFileData parentData = this.cache.get(file.getParent().getName()); // Only if not already added if (!parentData.hasChildren(file.getData())) { final RamFileObject parent = (RamFileObject) file.getParent(); parent.getData().addChild(file.getData()); parent.close(); } } // Store in cache cache.put(file.getName(), file.getData()); file.getData().updateLastModified(); file.close(); }
if (file.getData().getName() == null)