@Override public void setLength(final long newLength) throws IOException { this.file.resize(newLength); this.buf = this.file.getData().getContent(); } }
@Override public void setLength(final long newLength) throws IOException { this.file.resize(newLength); this.buf = this.file.getData().getContent(); } }
@Override public void setLength(final long newLength) throws IOException { this.file.resize(newLength); this.buf = this.file.getData().getContent(); } }
@Override public void setLength(final long newLength) throws IOException { this.file.resize(newLength); this.buf = this.file.getData().getContent(); } }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { final RamFileData data = this.file.getData(); final int size = data.size(); final int newSize = size + len; // Store the Exception in order to notify the client again on close() try { this.file.resize(newSize); } catch (final IOException e) { this.exception = e; throw e; } System.arraycopy(b, off, data.getContent(), size, len); }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { final RamFileData data = this.file.getData(); final int size = data.size(); final int newSize = size + len; // Store the Exception in order to notify the client again on close() try { this.file.resize(newSize); } catch (final IOException e) { this.exception = e; throw e; } System.arraycopy(b, off, data.getContent(), size, len); }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { final RamFileData data = this.file.getData(); final int size = data.size(); final int newSize = size + len; // Store the Exception in order to notify the client again on close() try { this.file.resize(newSize); } catch (final IOException e) { this.exception = e; throw e; } System.arraycopy(b, off, data.getContent(), size, len); }
@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 public void write(final byte[] b, final int off, final int len) throws IOException { if (this.getLeftBytes() < len) { final int newSize = this.buf.length + len - this.getLeftBytes(); this.file.resize(newSize); this.buf = this.file.getData().getContent(); } System.arraycopy(b, off, this.buf, filePointer, len); this.filePointer += len; }
@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 public void write(final byte[] b, final int off, final int len) throws IOException { final RamFileData data = this.file.getData(); final int size = data.size(); final int newSize = size + len; // Store the Exception in order to notify the client again on close() try { this.file.resize(newSize); } catch (final IOException e) { this.exception = e; throw e; } System.arraycopy(b, off, data.getContent(), size, len); }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { if (this.getLeftBytes() < len) { final int newSize = this.buf.length + len - this.getLeftBytes(); this.file.resize(newSize); this.buf = this.file.getData().getContent(); } System.arraycopy(b, off, this.buf, filePointer, len); this.filePointer += len; }
@Override public void write(final byte[] b, final int off, final int len) throws IOException { if (this.getLeftBytes() < len) { final int newSize = this.buf.length + len - this.getLeftBytes(); this.file.resize(newSize); this.buf = this.file.getData().getContent(); } System.arraycopy(b, off, this.buf, filePointer, len); this.filePointer += len; }
@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 public void write(final byte[] b, final int off, final int len) throws IOException { if (this.getLeftBytes() < len) { final int newSize = this.buf.length + len - this.getLeftBytes(); this.file.resize(newSize); this.buf = this.file.getData().getContent(); } System.arraycopy(b, off, this.buf, filePointer, len); this.filePointer += len; }
/** * @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); }
/** * @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); }