mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
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:
@@ -27,7 +27,7 @@
|
|||||||
package org.alfresco.repo.dictionary;
|
package org.alfresco.repo.dictionary;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -35,9 +35,11 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TreeSet;
|
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;
|
||||||
@@ -271,15 +273,23 @@ public class CMMDownloadTestUtil
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DownloadStatus getDownloadStatus(final NodeRef downloadNode)
|
public DownloadStatus getDownloadStatus(final NodeRef downloadNode)
|
||||||
{
|
{
|
||||||
return transactionHelper.doInTransaction(new RetryingTransactionCallback<DownloadStatus>()
|
return AuthenticationUtil.runAsSystem(new RunAsWork<DownloadStatus>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public DownloadStatus execute() throws Throwable
|
public DownloadStatus doWork() throws Exception
|
||||||
{
|
{
|
||||||
return downloadService.getDownloadStatus(downloadNode);
|
return transactionHelper.doInTransaction(new RetryingTransactionCallback<DownloadStatus>()
|
||||||
}
|
{
|
||||||
});
|
@Override
|
||||||
|
public DownloadStatus execute() throws Throwable
|
||||||
|
{
|
||||||
|
return downloadService.getDownloadStatus(downloadNode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user