public boolean uploadPkg(String uploadFilePath) throws Exception {
MultipartPostMethod filePost;
String uploadURL = "/eosmgr/eos/Deploy.jsp?command=upload";
filePost = new MultipartPostMethod(uploadURL);
filePost.addParameter("uploadfile", new File(uploadFilePath));
client.getHttpConnectionManager().getParams()
.setConnectionTimeout(5000);
int status = client.executeMethod(filePost);
if (status != 200) {
logger.info("上传失败! return status : " + filePost.getStatusLine());
return false;
}
try {
filePost.releaseConnection();
logger.info("上传成功!");
} catch (Exception e) {
logger.info("上传失败!错误信息:" + e.getMessage());
return false;
}
return true;
}
目的服务器locale出来是GBK,源服务器可能在windows也可能在GBK的linux环境。
http://www.itnose.net/detail/6144587.html
http://blog.csdn.net/lxb15959168136/article/details/50827394