/** * Return the destination of this file object if it's a symbolic link * * @return FileObject representing the linked to location */ @Override public SftpFileObject getLinkDestination() throws Exception { if (linkDestination == null) { final ChannelSftp channel = getAbstractFileSystem().getChannel(); try { final String path = channel.readlink(relPath); FileName relativeTo = getName().getParent(); if (relativeTo == null) { relativeTo = getName(); } FileName linkDestinationName = getFileSystem().getFileSystemManager().resolveName(relativeTo, path); linkDestination = (SftpFileObject) getFileSystem().resolveFile(linkDestinationName); } finally { getAbstractFileSystem().putChannel(channel); } } return linkDestination; } // [IntelliJ] WI-5627 --------------
.resolveName(getName(), UriParser.encode(name), NameScope.CHILD));
.resolveName(getName(), UriParser.encode(name), NameScope.CHILD));
.resolveName(getName(), UriParser.encode(name), NameScope.CHILD));
/** * 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); } }
/** * 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); } }
.resolveFile( getFileSystem().getFileSystemManager().resolveChildName( getName(), UriParser.encode(name)));
/** * 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); } }