@Override protected String[] doListChildren() throws Exception { return this.getAbstractFileSystem().listChildren(this.getName()); }
@Override protected String[] doListChildren() throws Exception { return this.getAbstractFileSystem().listChildren(this.getName()); }
@Override protected String[] doListChildren() throws Exception { return this.getAbstractFileSystem().listChildren(this.getName()); }
@Override protected String[] doListChildren() throws Exception { return this.getAbstractFileSystem().listChildren(this.getName()); }
@Override protected InputStream doGetInputStream() throws Exception { // VFS-210: ram allows to gather an input stream even from a directory. So we need to check the type anyway. if (!getType().hasContent()) { throw new FileSystemException("vfs.provider/read-not-file.error", getName()); } return new ByteArrayInputStream(this.data.getContent()); }
@Override protected InputStream doGetInputStream() throws Exception { // VFS-210: ram allows to gather an input stream even from a directory. So we need to check the type anyway. if (!getType().hasContent()) { throw new FileSystemException("vfs.provider/read-not-file.error", getName()); } return new ByteArrayInputStream(this.data.getContent()); }
@Override protected InputStream doGetInputStream() throws Exception { // VFS-210: ram allows to gather an input stream even from a directory. So we need to check the type anyway. if (!getType().hasContent()) { throw new FileSystemException("vfs.provider/read-not-file.error", getName()); } return new ByteArrayInputStream(this.data.getContent()); }
@Override protected InputStream doGetInputStream() throws Exception { // VFS-210: ram allows to gather an input stream even from a directory. So we need to check the type anyway. if (!getType().hasContent()) { throw new FileSystemException("vfs.provider/read-not-file.error", getName()); } return new ByteArrayInputStream(this.data.getContent()); }
@Override protected void doDelete() throws Exception { if (this.isContentOpen()) { throw new FileSystemException(this.getName() + " cannot be deleted while the file is openg"); } getAbstractFileSystem().delete(this); }
@Override protected void doDelete() throws Exception { if (this.isContentOpen()) { throw new FileSystemException(this.getName() + " cannot be deleted while the file is openg"); } getAbstractFileSystem().delete(this); }
@Override protected void doDelete() throws Exception { if (this.isContentOpen()) { throw new FileSystemException(this.getName() + " cannot be deleted while the file is openg"); } getAbstractFileSystem().delete(this); }
@Override protected void doDelete() throws Exception { if (this.isContentOpen()) { throw new FileSystemException(this.getName() + " cannot be deleted while the file is openg"); } getAbstractFileSystem().delete(this); }
/** * @param from The original file. * @param to The new file. * @throws FileSystemException if an error occurs. */ void rename(final RamFileObject from, final RamFileObject to) throws FileSystemException { if (!this.cache.containsKey(from.getName())) { throw new FileSystemException("File does not exist: " + from.getName()); } // Copy data to.getData().setContent(from.getData().getContent()); to.getData().setLastModified(from.getData().getLastModified()); to.getData().setType(from.getData().getType()); this.save(to); this.delete(from); }
/** * @param from The original file. * @param to The new file. * @throws FileSystemException if an error occurs. */ void rename(final RamFileObject from, final RamFileObject to) throws FileSystemException { if (!this.cache.containsKey(from.getName())) { throw new FileSystemException("File does not exist: " + from.getName()); } // Copy data to.getData().setContent(from.getData().getContent()); to.getData().setLastModified(from.getData().getLastModified()); to.getData().setType(from.getData().getType()); this.save(to); this.delete(from); }
/** * @param from The original file. * @param to The new file. * @throws FileSystemException if an error occurs. */ void rename(final RamFileObject from, final RamFileObject to) throws FileSystemException { if (!this.cache.containsKey(from.getName())) { throw new FileSystemException("File does not exist: " + from.getName()); } // Copy data to.getData().setContent(from.getData().getContent()); to.getData().setLastModified(from.getData().getLastModified()); to.getData().setType(from.getData().getType()); this.save(to); this.delete(from); }
/** * Delete a file * * @param file * @throws FileSystemException */ void delete(final RamFileObject file) throws FileSystemException { // root is read only check if (file.getParent() == null) { throw new FileSystemException("unable to delete root"); } // Remove reference from cache this.cache.remove(file.getName()); // Notify the parent final RamFileObject parent = (RamFileObject) this.resolveFile(file.getParent().getName()); parent.getData().removeChild(file.getData()); parent.close(); // Close the file file.getData().clear(); file.close(); }