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.
"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?
User contributions licensed under CC BY-SA 3.0