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

@@ -27,7 +27,7 @@
package org.alfresco.repo.dictionary;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.Serializable;
import java.util.Collection;
@@ -35,9 +35,11 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import org.alfresco.model.ContentModel;
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.RetryingTransactionCallback;
import org.alfresco.service.cmr.download.DownloadService;
@@ -271,15 +273,23 @@ public class CMMDownloadTestUtil
return null;
}
public DownloadStatus getDownloadStatus(final NodeRef downloadNode)
{
return transactionHelper.doInTransaction(new RetryingTransactionCallback<DownloadStatus>()
{
@Override
public DownloadStatus execute() throws Throwable
{
return downloadService.getDownloadStatus(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>()
{
@Override
public DownloadStatus execute() throws Throwable
{
return downloadService.getDownloadStatus(downloadNode);
}
});
}
});
}
}