Android Ftp 简单上传下载
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
页:
[1]