Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (4.3/Cloud)

72743: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud)
      72388: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.3)
         72287: Merged V3.4-BUG-FIX (3.4.15) to V4.1-BUG-FIX (4.1.10)
            72240: MNT-11319: Merged DEV to V3.4-BUG-FIX (3.4.15).
               71633: MNT-11319 Accented Characters wrongly unzipped
                         In Import dialog was added ZIP file contains high-byte filename characters such as Japanese, Chinese or Korean check box. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@74741 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Will Abson
2014-06-25 15:38:54 +00:00
parent 457b7e6048
commit 4c69e0c58c

View File

@@ -75,6 +75,8 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
private static final String TEMP_FILE_SUFFIX_ACP = ".acp"; private static final String TEMP_FILE_SUFFIX_ACP = ".acp";
private static final String TEMP_FILE_SUFFIX_ZIP = ".zip"; private static final String TEMP_FILE_SUFFIX_ZIP = ".zip";
private boolean highByteZip = false;
/** /**
* The importer service * The importer service
*/ */
@@ -135,6 +137,22 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
this.fileFolderService = fileFolderService; this.fileFolderService = fileFolderService;
} }
/**
* @return the highByteZip encoding switch
*/
public boolean isHighByteZip()
{
return this.highByteZip;
}
/**
* @param highByteZip the encoding switch for high-byte ZIP filenames to set
*/
public void setHighByteZip(boolean highByteZip)
{
this.highByteZip = highByteZip;
}
/** /**
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(org.alfresco.repo.ref.NodeRef, org.alfresco.repo.ref.NodeRef) * @see org.alfresco.repo.action.executer.ActionExecuter#execute(org.alfresco.repo.ref.NodeRef, org.alfresco.repo.ref.NodeRef)
*/ */
@@ -184,8 +202,7 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
// NOTE: This encoding allows us to workaround bug: // NOTE: This encoding allows us to workaround bug:
// http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4820807 // http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4820807
// We also try to use the extra encoding information if present // We also try to use the extra encoding information if present
// ALF-2016 zipFile = new ZipFile(tempFile, isHighByteZip() ? "Cp437" : null, true);
zipFile = new ZipFile(tempFile, "UTF-8", true);
// build a temp dir name based on the ID of the noderef we are importing // build a temp dir name based on the ID of the noderef we are importing
// also use the long life temp folder as large ZIP files can take a while // also use the long life temp folder as large ZIP files can take a while