public class FtpClient extends Object
修飾子とタイプ | クラスと説明 |
---|---|
static class |
FtpClient.TransferMode |
コンストラクタと説明 |
---|
FtpClient()
コンストラクタ
|
FtpClient(String host)
コンストラクタ
|
FtpClient(String host,
String user,
String password)
コンストラクタ
|
修飾子とタイプ | メソッドと説明 |
---|---|
void |
abort()
処理を中断します
|
void |
account(String acct)
課金情報を送信します
|
void |
append(String file)
ファイルを送信します
|
void |
append(String remoteFile,
InputStream in)
ファイルを送信します
|
void |
append(String remoteFile,
String localFile)
ファイルを送信します
|
void |
cd(String dir)
ディレクトリを変更します
|
void |
cdup()
一つ上のディレクトリに移動します
|
void |
close()
接続をクローズします
|
void |
connect()
FTP Serverに接続します。
|
void |
connect(String host,
int nPort)
指定されたポートでFTP Serverに接続します。
|
void |
delete(String file)
ファイルを削除します
|
void |
disconnect()
FTP Serverとの接続を解除します。
|
void |
get(String file)
ファイルを受信します
|
void |
get(String remoteFile,
OutputStream out)
ファイルを受信します
|
void |
get(String remoteFile,
String localFile)
ファイルを受信します
|
protected Socket |
getDataSocket()
データ接続を取得します
|
protected String |
getDirectoryName()
レスポンス文字列からディレクトリ名を切り出す
|
String |
getHost()
ホスト(host)を取得します。
|
String |
getMessage()
送信したコマンドに対するレスポンスを返します。
|
String |
getPassword()
パスワード(password)を取得します。
|
int |
getPort()
ポート番号(port)を取得します。
|
String |
getResponse()
送信したコマンドに対する応答メッセージを返します。
|
int |
getResponseCode()
送信したコマンドに対する最終のレスポンスコードを返します。
|
int |
getTimeout()
タイムアウト時間(ミリ秒)(timeout)を取得します。
|
String |
getUser()
ユーザ名(user)を取得します。
|
String |
help()
ヘルプを取得します
|
List<FtpFile> |
list()
ファイル一覧を取得します
|
void |
login(String user,
String password)
FTP Serverにログインします
|
void |
mkdir(String dir)
ディレクトリを作成します
|
void |
noop()
何もしません
|
int |
parseResponseCode(String response)
応答メッセージからレスポンスコードを解析します
|
void |
passive()
Passiveモードを設定します
|
void |
port()
データポートを指定します
|
protected void |
prepareDataSocket()
データ接続の準備を行います
|
void |
put(String file)
ファイルを送信します
|
void |
put(String remoteFile,
InputStream in,
boolean bUniq)
ファイルを送信します
|
void |
put(String remoteFile,
String localFile)
ファイルを送信します
|
void |
put(String remoteFile,
String localFile,
boolean bUniq)
ファイルを送信します
|
String |
pwd()
現在のディレクトリを取得します
|
protected void |
readDataStream(OutputStream out)
データ接続からデータを読み込みます
|
protected void |
readResponse()
応答を読み込みます
|
protected boolean |
ready()
応答を取得できる状態であるかを確認します
|
void |
rename(String from,
String to)
ファイル名を変更します
|
void |
rmdir(String dir)
ディレクトリを削除します
|
protected void |
sendCommand(String cmd)
コマンドを送信し、応答を取得します
|
void |
setDebug(boolean debug)
デバッグモードの設定をします
|
void |
setHost(String var)
ホスト(host)を設定します。
|
void |
setPassive(boolean pasv)
Passiveモードの設定をします
|
void |
setPassword(String var)
パスワード(password)を設定します。
|
void |
setPort(int var)
ポート番号(port)を設定します。
|
void |
setTimeout(int var)
タイムアウト時間(ミリ秒)(timeout)を設定します。
|
void |
setUser(String var)
ユーザ名(user)を設定します。
|
String |
site()
SITEパラメータを取得します
|
String |
stat()
ステータスを取得します
|
String |
system()
システム名称を取得します
|
void |
type(FtpClient.TransferMode mode)
ファイルタイプを設定します
|
protected void |
writeCommand(String cmd)
コマンドを送信します
|
protected void |
writeDataStream(InputStream in)
データ接続にデータを書き込みます
|
public FtpClient()
public FtpClient(String host) throws IOException, FtpServerException
host
- 接続先ホスト名IOException
FtpServerException
public FtpClient(String host, String user, String password) throws IOException, FtpServerException
host
- 接続先ホスト名user
- ユーザ名password
- パスワードIOException
FtpServerException
public void setHost(String var)
var
- 設定するデータpublic String getHost()
public void setPort(int var)
var
- 設定するデータpublic int getPort()
public void setUser(String var)
var
- 設定するデータpublic String getUser()
public void setPassword(String var)
var
- 設定するデータpublic String getPassword()
public void setDebug(boolean debug)
debug
- true:デバッグモード false:通常モードpublic void setPassive(boolean pasv)
pasv
- true:Passiveモード false:通常モードpublic String getResponse()
public void setTimeout(int var)
var
- 設定するデータpublic int getTimeout()
public int getResponseCode()
public int parseResponseCode(String response)
public String getMessage()
protected String getDirectoryName()
protected void sendCommand(String cmd) throws IOException
IOException
protected void writeCommand(String cmd) throws IOException
IOException
protected boolean ready() throws IOException
IOException
protected void readResponse() throws IOException
IOException
protected void prepareDataSocket() throws IOException, FtpServerException
protected Socket getDataSocket() throws IOException, FtpServerException
protected void readDataStream(OutputStream out) throws IOException, FtpServerException
protected void writeDataStream(InputStream in) throws IOException, FtpServerException
public void connect() throws IOException, UnknownHostException, FtpServerException
public void connect(String host, int nPort) throws IOException, UnknownHostException, FtpServerException
host
- 接続先ホスト名nPort
- 接続先ポート番号IOException
UnknownHostException
FtpServerException
public void disconnect() throws IOException, UnknownHostException, FtpServerException
public void login(String user, String password) throws IOException, FtpServerException
user
- ユーザ名password
- パスワードIOException
FtpServerException
public void account(String acct) throws IOException, FtpServerException
acct
- 課金情報IOException
FtpServerException
public void port() throws IOException, FtpServerException
public void passive() throws IOException, FtpServerException
public List<FtpFile> list() throws IOException, FtpServerException
IOException
FtpServerException
public void get(String file) throws IOException, FtpServerException
public void get(String remoteFile, String localFile) throws IOException, FtpServerException
public void get(String remoteFile, OutputStream out) throws IOException, FtpServerException
public void put(String file) throws IOException, FtpServerException
public void put(String remoteFile, String localFile) throws IOException, FtpServerException
public void put(String remoteFile, String localFile, boolean bUniq) throws IOException, FtpServerException
public void put(String remoteFile, InputStream in, boolean bUniq) throws IOException, FtpServerException
public void append(String file) throws IOException, FtpServerException
public void append(String remoteFile, String localFile) throws IOException, FtpServerException
public void append(String remoteFile, InputStream in) throws IOException, FtpServerException
public void rename(String from, String to) throws IOException, FtpServerException
public void abort() throws IOException, FtpServerException
public void delete(String file) throws IOException, FtpServerException
public void mkdir(String dir) throws IOException, FtpServerException
public void rmdir(String dir) throws IOException, FtpServerException
public String site() throws IOException, FtpServerException
public void noop() throws IOException, FtpServerException
public String system() throws IOException, FtpServerException
public String stat() throws IOException, FtpServerException
public void type(FtpClient.TransferMode mode) throws IOException, FtpServerException
public void cd(String dir) throws IOException, FtpServerException
public void cdup() throws IOException, FtpServerException
public String pwd() throws IOException, FtpServerException
public String help() throws IOException, FtpServerException
public void close() throws IOException, FtpServerException
Copyright © 2021 S.D.S Co.,Ltd.. All rights reserved.