3 import java
.io
.IOException
;
5 import java
.nio
.file
.FileSystem
;
6 import java
.nio
.file
.Path
;
8 import org
.apache
.sshd
.client
.subsystem
.sftp
.fs
.SftpFileSystem
;
10 public class Sftp
extends AbstractSsh
{
13 private SftpFileSystem fileSystem
;
15 public Sftp(URI uri
) {
20 public FileSystem
getFileSystem() {
21 if (fileSystem
== null) {
24 fileSystem
= getSftpFileSystemProvider().newFileSystem(getSession());
25 } catch (IOException e
) {
26 throw new IllegalStateException(e
);
32 public Path
getBasePath() {
33 String p
= uri
.getPath() != null ? uri
.getPath() : "/";
34 return getFileSystem().getPath(p
);