Merged WEBAPP-API (5.2.1) to 5.2.N (5.2.1)

134647 cpopa: APPSREPO-105 : Add an API to download multiple file/folders as a zip
      - Shy attempt to fix the TestCustomModelExport.testCreateDownload test


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@134672 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Constantin Popa
2017-01-20 12:56:40 +00:00
parent c5baf57662
commit 1233beb56e

View File

@@ -38,6 +38,8 @@ import java.util.TreeSet;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.RetryingTransactionHelper; import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.download.DownloadService; import org.alfresco.service.cmr.download.DownloadService;
@@ -272,6 +274,11 @@ public class CMMDownloadTestUtil
} }
public DownloadStatus getDownloadStatus(final NodeRef downloadNode) public DownloadStatus getDownloadStatus(final NodeRef downloadNode)
{
return AuthenticationUtil.runAsSystem(new RunAsWork<DownloadStatus>()
{
@Override
public DownloadStatus doWork() throws Exception
{ {
return transactionHelper.doInTransaction(new RetryingTransactionCallback<DownloadStatus>() return transactionHelper.doInTransaction(new RetryingTransactionCallback<DownloadStatus>()
{ {
@@ -282,4 +289,7 @@ public class CMMDownloadTestUtil
} }
}); });
} }
});
}
} }