{
// VFS-210: sftp allows to gather an input stream even from a directory and will
// fail on first read. So we need to check the type anyway
if (!getType().hasContent())
{
throw new FileSystemException("vfs.provider/read-not-file.error", getName());
}
is = channel.get(relPath);
}
catch (SftpException e)
{
if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE)
{
throw new FileNotFoundException(getName());
}
throw new FileSystemException(e);
}
return new SftpInputStream(channel, is);
}