private void flushStat() throws IOException, SftpException { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { channel.setStat(relPath, attrs); } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Creates this file as a folder. */ @Override protected void doCreateFolder() throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { channel.mkdir(relPath); } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Creates this file as a folder. */ @Override protected void doCreateFolder() throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { channel.mkdir(relPath); } finally { getAbstractFileSystem().putChannel(channel); } }
private void flushStat() throws IOException, SftpException { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { channel.setStat(relPath, attrs); } finally { getAbstractFileSystem().putChannel(channel); } }
private void flushStat() throws IOException, SftpException { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { channel.setStat(relPath, attrs); } finally { getAbstractFileSystem().putChannel(channel); } }
private void flushStat() throws IOException, SftpException { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { channel.setStat(relPath, attrs); } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Creates this file as a folder. */ @Override protected void doCreateFolder() throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { channel.mkdir(relPath); } finally { getAbstractFileSystem().putChannel(channel); } }
@Override protected String doGetCurrentDir() throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { return channel.pwd(); } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Rename the file. */ @Override protected void doRename(final FileObject newFile) throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { final SftpFileObject newSftpFileObject = (SftpFileObject) FileObjectUtils.getAbstractFileObject(newFile); channel.rename(relPath, newSftpFileObject.relPath); } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Rename the file. */ @Override protected void doRename(final FileObject newFile) throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { final SftpFileObject newSftpFileObject = (SftpFileObject) FileObjectUtils.getAbstractFileObject(newFile); channel.rename(relPath, newSftpFileObject.relPath); } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Rename the file. */ @Override protected void doRename(final FileObject newFile) throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { final SftpFileObject newSftpFileObject = (SftpFileObject) FileObjectUtils.getAbstractFileObject(newFile); channel.rename(relPath, newSftpFileObject.relPath); } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Deletes the file. */ @Override protected void doDelete() throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { if (isFile()) { channel.rm(relPath); } else { channel.rmdir(relPath); } } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Creates an output stream to write the file content to. */ @Override protected OutputStream doGetOutputStream(final boolean bAppend) throws Exception { // TODO - Don't write the entire file into memory. Use the stream-based // methods on ChannelSftp once the work properly /* * final ChannelSftp channel = getAbstractFileSystem().getChannel(); return new SftpOutputStream(channel); */ final ChannelSftp channel = getAbstractFileSystem().getChannel(); return new SftpOutputStream(channel, channel.put(relPath)); }
/** * Deletes the file. */ @Override protected void doDelete() throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { if (isFile()) { channel.rm(relPath); } else { channel.rmdir(relPath); } } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Deletes the file. */ @Override protected void doDelete() throws Exception { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { if (isFile()) { channel.rm(relPath); } else { channel.rmdir(relPath); } } finally { getAbstractFileSystem().putChannel(channel); } }
/** * Creates an output stream to write the file content to. */ @Override protected OutputStream doGetOutputStream(final boolean bAppend) throws Exception { // TODO - Don't write the entire file into memory. Use the stream-based // methods on ChannelSftp once the work properly /* * final ChannelSftp channel = getAbstractFileSystem().getChannel(); return new SftpOutputStream(channel); */ final ChannelSftp channel = getAbstractFileSystem().getChannel(); return new SftpOutputStream(channel, channel.put(relPath)); }
/** * Creates an output stream to write the file content to. */ @Override protected OutputStream doGetOutputStream(final boolean bAppend) throws Exception { // TODO - Don't write the entire file into memory. Use the stream-based // methods on ChannelSftp once the work properly /* * final ChannelSftp channel = getAbstractFileSystem().getChannel(); return new SftpOutputStream(channel); */ final ChannelSftp channel = getAbstractFileSystem().getChannel(); return new SftpOutputStream(channel, channel.put(relPath, bAppend ? ChannelSftp.APPEND : ChannelSftp.OVERWRITE)); }
/** * Creates an output stream to write the file content to. */ @Override protected OutputStream doGetOutputStream(final boolean bAppend) throws Exception { // TODO - Don't write the entire file into memory. Use the stream-based // methods on ChannelSftp once the work properly /* final ChannelSftp channel = getAbstractFileSystem().getChannel(); return new SftpOutputStream(channel); */ final ChannelSftp channel = getAbstractFileSystem().getChannel(); return new SftpOutputStream(channel, channel.put(relPath)); }
/** * Creates an input stream to read the file content from. The input stream is starting at the given position in the * file. */ InputStream getInputStream(final long filePointer) throws IOException { final ChannelSftp channel = getAbstractFileSystem().getChannel(); // Using InputStream directly from the channel // is much faster than the memory method. try { final InputStream is = channel.get(getName().getPathDecoded(), null, filePointer); return new SftpInputStream(channel, is); } catch (final SftpException e) { getAbstractFileSystem().putChannel(channel); throw new FileSystemException(e); } }
/** * Creates an input stream to read the file content from. The input stream is starting at the given position in the * file. */ InputStream getInputStream(final long filePointer) throws IOException { final ChannelSftp channel = getAbstractFileSystem().getChannel(); // Using InputStream directly from the channel // is much faster than the memory method. try { final InputStream is = channel.get(getName().getPathDecoded(), null, filePointer); return new SftpInputStream(channel, is); } catch (final SftpException e) { getAbstractFileSystem().putChannel(channel); throw new FileSystemException(e); } }