001 /*
002 * Copyright (c) 2009 The openGion Project.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013 * either express or implied. See the License for the specific language
014 * governing permissions and limitations under the License.
015 */
016 package org.opengion.fukurou.util;
017
018 /**
019 * ConnectIF.java は、サーバã?アクセス関連のクラスをå?通的に使用するためのインターフェースですã?
020 *
021 * connect()、action( String command, String localFile, String remoteFile )、disconnect() の
022 * ä¸??処ç�??メソãƒ?ƒ‰と、setHostUserPass( String host , String user , String pass ) 、getErrMsg() の
023 * 簡易的な共通メソãƒ?ƒ‰を用意してã�?�¾すã?
024 *
025 * @og.rev 5.1.6.0 (2010/05/01) 新規追åŠ?
026 *
027 * @version 5.0
028 * @author Kazuhiko Hasegawa
029 * @since JDK5.0,
030 */
031 public interface ConnectIF {
032
033 /**
034 * サーバã?への接続ã?ログインを行いますã?
035 *
036 * こã?メソãƒ?ƒ‰は、å?期化メソãƒ?ƒ‰ですã?
037 * 接続å?を変更する場合ã?、もã�?¸?º¦こã?メソãƒ?ƒ‰をコールするå¿?¦�がありますã?
038 * (そã?ような場合ã?ã€??常、オブジェクトを構築しなおす方がよã�?�¨思いますã?)
039 */
040 public void connect() ;
041
042 /**
043 * command , localFile , remoteFile をå?に、å?ç�?‚’行いますã?
044 *
045 * こã?メソãƒ?ƒ‰は、connect()メソãƒ?ƒ‰実行後に、呼び出すå¿?¦�がありますã?
046 *
047 * @param command GET/PUT/DEL など
048 * @param localFile ローカルのファイルå�?
049 * @param remoteFile 接続å?のファイルå�?
050 */
051 public void action( final String command, final String localFile, final String remoteFile );
052
053 /**
054 * サーバã?との接続をクローズしますã?
055 *
056 * ログインされてã�?‚‹場合ã?、ログアウトも行いますã?
057 * コネクトされてã�?‚‹場合ã?、ディスコネクトしますã?
058 */
059 public void disconnect();
060
061 /**
062 * サーバã?の、ã?ストã?ユーザー、パスワードを設定しますã?
063 *
064 * @param host サーバã?
065 * @param user ユーザー
066 * @param pass パスワーãƒ?
067 */
068 public void setHostUserPass( final String host , final String user , final String pass );
069
070 /**
071 * 接続に利用するポã?ト番号を設定しますã?
072 *
073 * @param port 接続に利用するポã?ト番号
074 */
075 public void setPort( final String port ) ;
076
077 /**
078 * それぞれの受け側ファイルにãƒ?‚£レクトリを作æ?するかどã�?�‹(初期値:true:作æ?する)ã€?
079 *
080 * -mkdirs=[true/false] は、受けå?のファイル(GETæ™?LOCAL、PUTæ™?サーバã?)に取り込ã‚?ƒ•ァイルのãƒ?‚£レクトリã�?
081 * 存在しなã�??合に、作æ?するかどã�?�‹を指定しまã�?初期値:true)ã€?
082 * 通常、サーバã?に、フォルãƒ?šŽ層を作æ?してPUTする場合ã?動的にフォルãƒ?šŽ層を作æ?したã�?‚±ースで便利ですã?
083 * é€?�«、フォルãƒ??確定しており、指定フォルãƒ?»¥外に PUT するのはバグってã�?‚‹と事がåˆ?�‹ってã�?‚‹場合には
084 * false に設定して、存在しなã�?ƒ•ォルãƒ?�«PUT しよã�?�¨すると、エラーになるよã�?�«しますã?
085 *
086 * @param isMkdirs 受け側ファイルにãƒ?‚£レクトリを作æ?するかどã�?�‹。true:作æ?する
087 */
088 public void setMkdirs( final boolean isMkdirs ) ;
089
090 /**
091 * Dataタイãƒ?‚¢ウトを秒でæŒ?®šしまã�?初期値:600 [秒])ã€?
092 *
093 * オリジナルの FTPClient#setDataTimeout( int ) は、ミリ秒でセãƒ?ƒˆ
094 * しますが、ここã?メソãƒ?ƒ‰では、秒でセãƒ?ƒˆしますã?
095 *
096 * @param timeout タイãƒ?‚¢ウãƒ?秒]
097 */
098 public void setTimeout( final int timeout ) ;
099
100 /**
101 * 実行状況ã?表示可否 を設定しまã�?初期値:false:表示しなã�?ã€?
102 *
103 * @param isDisplay 実行状況ã?表示可否
104 */
105 public void setDisplay( final boolean isDisplay ) ;
106
107 /**
108 * ãƒ?ƒ�ãƒ?‚°æƒ??の表示可否 を設定しまã�?初期値:false:表示しなã�?ã€?
109 *
110 * @param isDebug ãƒ?ƒ�ãƒ?‚°æƒ??の表示可否
111 */
112 public void setDebug( final boolean isDebug ) ;
113
114 /**
115 * 処ç�?¸に発生したエラーメãƒ?‚»ージを取りå?しますã?
116 *
117 * @return エラーメãƒ?‚»ージ
118 */
119 public String getErrMsg();
120 }