0
我見過使用java.util.zip.ZipEntry我們可以壓縮文件。java ftp zip更好的方法
我能壓縮它,還我從一個FTP位置和其他FTP位置
outStream.putNextEntry(new ZipEntry());
while ((ByteRead = is.read(buf)) != -1)
{
outStream.write(buf, 0, ByteRead);
ByteWritten += ByteRead;
}
我也看到它轉移有沒有一些方法FTP.sendCommand()。 但不知道如何使用它發送命令來壓縮一個FTP位置的文件並使用此方法複製到另一個文件。
有沒有人對此有任何意見?
FTP.sendCommand()用於FTP命令,爲了壓縮遠程文件,我會說你需要使用SSH。 – lynks
[zip文件存在於一個FTP位置並直接複製到另一個FTP位置]的可能重複(http://stackoverflow.com/questions/12933180/zip-the-files-which-are-present-at- one-ftp-location-and-copy-to-another-ftp-loca) – fglez