中找出我的文件位置我已经使用这个代码如何FTP文件传输
import org.apache.commons.net.ftp.FTPClient;
import java.io.FileInputStream;
import java.io.IOException;
public class FTPClientExample {
public static void main(String[] args) {
FTPClient client = new FTPClient();
FileInputStream fis = null;
try {
client.connect("hostname");
client.login("user", "pwd");
String filename = "D:\\Task\\try.txt";
fis = new FileInputStream(filename);
client.storeFile(filename, fis);
client.logout();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (fis != null) {
fis.close();
}
client.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
当我运行它,我得到的消息任务complete.But我不能找出我应该去找哪个文件夹file.some你能帮助我吗?
你已经指定路径“D:\\ Task \\ try.txt”,所以看看那里 – 2012-08-02 10:20:54
其实我在那里犯了一个错误。 String remote =“root”; fis = new FileInputStream(filename); client.storeFile(remote,fis);仍然不能在根文件夹中找到文件 – Satheesh 2012-08-02 10:28:32
@HarmeetSingh它的一台Linux机器,我知道如何提及文件夹结构 – Satheesh 2012-08-02 10:30:24