mFTPClient.disconnect();
} catch(IOException exc2) {
// do nothing
}
}
throw new UpdateException("Could not connect to server '" + mServerUrl
+ "'", exc);
}
// Log in
try {
boolean success = mFTPClient.login(mUser, mPassword);
checkReplyCode();
if (! success) {
throw new UpdateException("Login failed");
}
} catch (Exception exc) {
throw new UpdateException("Login using user='" + mUser
+ "' and password=(" + mPassword.length() + " characters) failed", exc);
}
// Set the file type to binary
try {
boolean success = mFTPClient.setFileType(FTP.BINARY_FILE_TYPE);
checkReplyCode();
if (! success) {
throw new UpdateException("Setting file type to binary failed");
}
} catch (Exception exc) {
throw new UpdateException("Setting file type to binary failed", exc);
}
// Change directory
try {
boolean success = mFTPClient.changeWorkingDirectory(mPath);
checkReplyCode();
if (! success) {
throw new UpdateException("Could not change to directory '" + mPath + "'");
}
} catch (Exception exc) {
throw new UpdateException("Could not change to directory '" + mPath + "'",
exc);
}
mLog.fine("Changed to directory " + mPath);
}