我正在尝试使用Verizon LG Revolution Android智能手机上的URLConnection从我的服务器传输数据。下面的块适用于Sprint和MetroPCS的Android手机,但Verizon的Android手机似乎在使用ftp时遇到问题。在调用getInputStream()之后捕获异常e3。
try{
URL url;
try {
url = new URL("ftp://myUsername:myPassword@myWebsite.com/myFile.txt");
URLConnection urlCon = null;
try {
urlCon = url.openConnection();
urlCon.setDoInput(true);
InputStream input = urlCon.getInputStream(); //This is the line that the exception below is caught
} catch (Exception e3) {
//Cannot connect to server; Unable to retrieve file: 425
}
} catch (MalformedURLException e2) {
}
}catch(Exception e){
}