Search in sources :

Example 31 with FileNotFoundException

use of org.alfresco.service.cmr.model.FileNotFoundException in project records-management by Alfresco.

the class RM978Test method testCopyFolderInFolderInRmSite.

public void testCopyFolderInFolderInRmSite() {
    doBehaviourDrivenTest(new BehaviourDrivenTest(AlfrescoRuntimeException.class, user) {

        private NodeRef folder1;

        private NodeRef rmCategory;

        private NodeRef rmFolder;

        public void given() {
            folder1 = fileFolderService.create(documentLibrary, GUID.generate(), ContentModel.TYPE_FOLDER).getNodeRef();
            runAs(new RunAsWork<Void>() {

                public Void doWork() throws Exception {
                    rmCategory = filePlanService.createRecordCategory(filePlan, GUID.generate());
                    rmFolder = recordFolderService.createRecordFolder(rmCategory, GUID.generate());
                    return null;
                }
            }, getAdminUserName());
        }

        public void when() throws FileExistsException, FileNotFoundException {
            fileFolderService.copy(folder1, rmFolder, GUID.generate());
        }
    });
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) RunAsWork(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork) FileNotFoundException(org.alfresco.service.cmr.model.FileNotFoundException) AlfrescoRuntimeException(org.alfresco.error.AlfrescoRuntimeException) FileExistsException(org.alfresco.service.cmr.model.FileExistsException)

Aggregations

FileNotFoundException (org.alfresco.service.cmr.model.FileNotFoundException)31 NodeRef (org.alfresco.service.cmr.repository.NodeRef)23 FileInfo (org.alfresco.service.cmr.model.FileInfo)22 FileFolderService (org.alfresco.service.cmr.model.FileFolderService)7 FileExistsException (org.alfresco.service.cmr.model.FileExistsException)6 ArrayList (java.util.ArrayList)5 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)5 RunAsWork (org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork)5 QName (org.alfresco.service.namespace.QName)4 HashMap (java.util.HashMap)3 List (java.util.List)3 RetryingTransactionCallback (org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback)3 WebDavService (org.alfresco.service.cmr.webdav.WebDavService)3 Date (java.util.Date)2 HashSet (java.util.HashSet)2 LinkedHashSet (java.util.LinkedHashSet)2 Set (java.util.Set)2 StringTokenizer (java.util.StringTokenizer)2 TimerTask (java.util.TimerTask)2 FileContentReader (org.alfresco.repo.content.filestore.FileContentReader)2