I create zip file using ZipOutputStream. I put in the zip one file(both file and zip are in the same dir), however开发者_Go百科 the file is stored with fullpath (C:\TEMP\file.xml), how to store it with relative or no path?
You need to set that in the ZipEntry. For example, if you don't want any path, just use the name of the file in your ZipEntry, like this:
File f = new File("C:\\temp\\file.xml");
ZipEntry entry = new ZipEntry(f.getName());
精彩评论