|
|
|
@ -7,6 +7,7 @@ import it.tref.liferay.portos.bo.service.AllegatoManualeServiceUtil;
|
|
|
|
|
import java.io.File; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
import java.nio.file.Files; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
@ -104,7 +105,10 @@ public class AllegatiManualiPortlet extends MVCPortlet {
|
|
|
|
|
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(doc.getFileEntryId()); |
|
|
|
|
inputStream = DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), |
|
|
|
|
fileEntry.getVersion(), false); |
|
|
|
|
String name = fileEntry.getTitle() + StringPool.PERIOD + fileEntry.getExtension(); |
|
|
|
|
String s = new String(fileEntry.getTitle().getBytes(StandardCharsets.UTF_8)); |
|
|
|
|
byte[] b = s.getBytes(StandardCharsets.ISO_8859_1); |
|
|
|
|
String name = new String(b, StandardCharsets.ISO_8859_1) + StringPool.PERIOD |
|
|
|
|
+ fileEntry.getExtension(); |
|
|
|
|
zipWriter.addEntry(name, inputStream); |
|
|
|
|
} finally { |
|
|
|
|
StreamUtil.cleanUp(inputStream); |
|
|
|
|