关闭

Android Ftp 简单上传下载

标签: androidurlos
3695人阅读 评论(1) 收藏 举报
   

URL url 
=
 
new
 URL
(
"ftp://mirror.csclub.uwaterloo.ca/index.html"
);

   
URLConnection urlConnection = url . openConnection ();
   
InputStream in = new BufferedInputStream ( urlConnection . getInputStream ());
   
try {
     readStream
( in );
   
finally {
     
in . close ();
   
}
 
}


URL url = new URL("ftp://user01:pass1234@ftp.foo.com/README.txt;type=i");
URLConnection urlc = url.openConnection();
InputStream is = urlc.getInputStream(); // To download
OutputStream os = urlc.getOutputStream(); // To upload




http://commons.apache.org/net/api/org/apache/commons/net/ftp/FTPClient.html


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:82952次
    • 积分:1100
    • 等级:
    • 排名:千里之外
    • 原创:17篇
    • 转载:52篇
    • 译文:0篇
    • 评论:11条
    最新评论