|
|
@ -30,6 +30,7 @@ import it.tref.liferay.portos.bo.util.WorkflowUtil; |
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.InputStream; |
|
|
|
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.nio.file.Files; |
|
|
|
import java.nio.file.Files; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
@ -59,6 +60,8 @@ import com.liferay.portal.kernel.language.LanguageUtil; |
|
|
|
import com.liferay.portal.kernel.log.Log; |
|
|
|
import com.liferay.portal.kernel.log.Log; |
|
|
|
import com.liferay.portal.kernel.log.LogFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.log.LogFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.repository.model.FileEntry; |
|
|
|
import com.liferay.portal.kernel.repository.model.FileEntry; |
|
|
|
|
|
|
|
import com.liferay.portal.kernel.sanitizer.Sanitizer; |
|
|
|
|
|
|
|
import com.liferay.portal.kernel.sanitizer.SanitizerUtil; |
|
|
|
import com.liferay.portal.kernel.search.Document; |
|
|
|
import com.liferay.portal.kernel.search.Document; |
|
|
|
import com.liferay.portal.kernel.search.Hits; |
|
|
|
import com.liferay.portal.kernel.search.Hits; |
|
|
|
import com.liferay.portal.kernel.servlet.HttpHeaders; |
|
|
|
import com.liferay.portal.kernel.servlet.HttpHeaders; |
|
|
@ -355,7 +358,9 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(doc.getDlFileEntryId()); |
|
|
|
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(doc.getDlFileEntryId()); |
|
|
|
inputStream = DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), |
|
|
|
inputStream = DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), |
|
|
|
fileEntry.getVersion(), false); |
|
|
|
fileEntry.getVersion(), false); |
|
|
|
String name = fileEntry.getTitle(); |
|
|
|
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); |
|
|
|
zipWriter.addEntry(name, inputStream); |
|
|
|
zipWriter.addEntry(name, inputStream); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
StreamUtil.cleanUp(inputStream); |
|
|
|
StreamUtil.cleanUp(inputStream); |
|
|
|