首先需要將兩個libs匯入,分別是commons-io-x.x與commons-net-x.x
在程式碼內
import org.apache.commons.net.ftp.FTPClient;
首先先設定
FTPClient ftpclient;
boolean connectSuccess = false;
boolean skipAnim = false;
ArrayList<String> images;
String ftpAddress = "192.168.0.1";
String userName = "ftp_id";
String passWord = "ftp_password";
String retrieveFromFTPFolder = "/your_folder/";
int port = 21;
FTPService ftpServer;
設定完後即可在需要呼叫的地方呼叫:
ftpServer = new FTPService(userName, passWord, ftpAddress, port,
retrieveFromFTPFolder);
即可連線
FTPservice服務不要忘記一起放進專案
2014年8月14日 星期四
2014年8月6日 星期三
install dovecot sendmail using webmin 收信錯誤問題
環境介紹:fedora 20 +webmin +dovecot+sendmail
主要是dovecot的部分,當用webmin安裝完dovecot跟sendmail後
開啟firewall的port讓服務啟動,用微軟live mail連接時
卻產生了0x800CCC90 0x800CCC92的錯誤碼
從伺服器的log來看 似乎是mail儲存位置沒設定
Aug 06 16:49:30 POP3(UserA): Error: user UserA Initialization failed: Namespace '': Mail storage autodetection failed with home=/home/UserA
在webmin裡面設定也無效
最後還是進入主機 設定mail儲存位置
首先
vi /etc/dovecot/conf.d/10-mail.conf
在30行左右的地方,解除標記並加上
mail_location = maildir:~/Maildir
mail_location = maildir:~/Maildir
service dovecot restart
這樣就ok了!!
2014年8月5日 星期二
VirtualBOx Appliance-19 Error Message 更新錯誤
Error relaunching VirtualBox VM process:5
Command line: '81954AF5-4D2F-31EB-A142-B7AF187A1C41-SUPLIB-2NDCHILD
--comment "CS50 Appliance 19_1" --startvm
e1971bc0-0443-4b19-98a1-50e50083167e --no-startvm-errormsgbox'
(rc=-104)
The way resolve it is downgrade from virtualbox 4.3.14 to 4.3.12
在Virtualbox裡面開啟時出現這個錯誤,問題是在virtual本身,更新到版本4.3.14 會有此問題
另外下載4.3.12降轉,也就是重新安裝即可...
訂閱:
文章 (Atom)