I create zip file using ZipOutputStream. I put in the zip one file(both file and zip are in the same dir), however the file is stored with fullpath (C:\TEMP\file.xml), how to store it with relative or no path?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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: