cancel
Showing results for 
Search instead for 
Did you mean: 

How to programmatically import and unpack a zip

ifairman
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to import a zip file using the ImporterService. I'd like to have the zip file unpacked as part of the process. I know this functionality exists in the GUI (I am using Alfresco 2.1) but finding the way to do this in the API is proving difficult. ACPImportPackageHandler only seems to handle ACP files (despite the import GUI pages lumping import of ACP and zip files together) and FileImportPackageHandler seems to think I should be passing it XML.

A quick look on the forum revealed this http://forums.alfresco.com/en/viewtopic.php?t=2490 which looks like it should do the trick and should have been submitted to the Alfresco codebase but can I find it…?

Many thanks in advance,

Ian.
1 REPLY 1

ifairman
Champ in-the-making
Champ in-the-making
Hi,

I think I may have the answer to my own question. Looking at the source for org.alfresco.repo.action.executor.ImporterActionExecuter it seems that the Importer API is used for ACP files but not for zip files - the action unzips the zip to a temporary directory and then loads the content in file-by-file.

Bit of a shame really…

Ian.