7
Apache Common vfsを使用して新規です。 成功しました。サーバに接続しました。 私はすでにドキュメントを読んでいますが、 ディレクトリ/ファイルを一覧表示する方法はありますか?Apacheを使用してファイルディレクトリ/ファイルを一覧表示する方法
....
Session session = null;
FileSystemManager fsManager = null;
FileSystem fs = null;
try {
String host = "host_here";
int port = 22;
String userStr = "user_here";
char [] username = userStr.toCharArray();
String passStr = "password_here";
char [] password = passStr.toCharArray();
session = SftpClientFactory.createConnection(host, port, username, password, null);
//session.connect();
System.out.println("Connected to the server");
FileSystemOptions opts = new FileSystemOptions();
fsManager = VFS.getManager();
FileObject file = fsManager.resolveFile("ftp://"+userStr+":"+passStr+"@"+host+"/home/", opts);
// .... whats next i do here? .....
} catch (Exception e) {
session.disconnect();
e.printStackTrace();
}
...
ファイルの:)
JSCHを使用しています:D しかし、私は、ディレクトリ(ファイルではない)を保存先ディレクトリに保存する方法は不思議ですか? – fanjavaid
新しいディレクトリを作成するか、すでにいくつかのファイルが入っているディレクトリを保存することを意味しますか? – SRy
はい、そうです。それが可能だ? – fanjavaid