I created a generated a zip file containing a csv file but this zip file only opens properly in macs but not in WIndows. Why is that?

1
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos);
ZipEntry entry = new ZipEntry(csvFileName + ".csv");
CsvSchema schema = csvMapper.schemaFor(Report.class).withHeader();

try {
    zos.putNextEntry(entry);
    List<Report> reports = getReports();
    String row = csvMapper.writer(schema).writeValueAsString(reports);
    zos.write(row.getBytes());
    zos.closeEntry();
    zos.close();
}
catch (Exception e) {
        return CompletionStages.createFailed(e);
    }

When the file is downloaded from mac, it works perfectly fine. However, it doesn't work when it's open from a Windows machine. Anyone know why this may be?

I've searched for the error retrieved: Code 0x80070057 The parameter is incorrect.

https://support.microsoft.com/en-us/help/3041857/code-0x80070057-the-parameter-is-incorrect-error-when-you-try-to-displ

"This problem occurs because the SECURITY_DESCRIPTOR structure that is returned by the server contains a NULL Owner field when the NetShareGetInfo call returns to Windows Explorer." -> Is there a way to set this parameter?

java
windows
csv
io
zip
asked on Stack Overflow Mar 9, 2018 by Vicky

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0