实现通过java操作命令行压缩文件

This commit is contained in:
2018-05-10 21:39:55 +08:00
parent f56c7ce02a
commit edcff8ef21
8 changed files with 325 additions and 49 deletions

View File

@@ -534,12 +534,12 @@ public class FtpOperationUtil {
return ftpClient.retrieveFileStream(sourceFileName);
}
public InputStream downFile(String path,String sourceFileName) throws IOException {
public InputStream downFile(String path, String sourceFileName) throws IOException {
sourceFileName = new String(sourceFileName.getBytes("UTF-8"), "iso-8859-1");
path = new String(path.getBytes("UTF-8"), "iso-8859-1");
if (path != null && path.length() != 0) {
boolean flagChange = ftpClient.changeWorkingDirectory(path);
System.out.println("【目录切换】" + flagChange);
System.out.println("【目录切换】" + path + flagChange);
}
return ftpClient.retrieveFileStream(sourceFileName);
}