protected Folder addFolder(long parentFolderId, String name, boolean deleteExisting) throws Exception { String description = StringPool.BLANK; ServiceContext serviceContext = new ServiceContext(); serviceContext.setAddGroupPermissions(true); serviceContext.setAddGuestPermissions(true); if (deleteExisting) { try { DLAppServiceUtil.deleteFolder(TestPropsValues.getGroupId(), parentFolderId, name); } catch (NoSuchFolderException nsfe) { } } return DLAppServiceUtil.addFolder( TestPropsValues.getGroupId(), parentFolderId, name, description, serviceContext); }
public void setUp() throws Exception { super.setUp(); String name = "Test Folder"; String description = "This is a test folder."; ServiceContext serviceContext = new ServiceContext(); serviceContext.setAddCommunityPermissions(true); serviceContext.setAddGuestPermissions(true); try { DLAppServiceUtil.deleteFolder(_groupId, DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, name); } catch (NoSuchFolderException nsfe) { } _folder = DLAppServiceUtil.addFolder( _groupId, DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, name, description, serviceContext); }