001
014
015 package com.liferay.portal.kernel.repository.util;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.repository.model.FileEntry;
019 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
020 import com.liferay.portal.service.ServiceContext;
021
022
025 public class RepositoryTrashUtil {
026
027 public static RepositoryTrash getRepositoryTrash() {
028 PortalRuntimePermission.checkGetBeanProperty(RepositoryTrashUtil.class);
029
030 return _repositoryTrash;
031 }
032
033 public static FileEntry moveFileEntryFromTrash(
034 long userId, long repositoryId, long fileEntryId, long newFolderId,
035 ServiceContext serviceContext)
036 throws PortalException {
037
038 return getRepositoryTrash().moveFileEntryFromTrash(
039 userId, repositoryId, fileEntryId, newFolderId, serviceContext);
040 }
041
042 public static FileEntry moveFileEntryToTrash(
043 long userId, long repositoryId, long fileEntryId)
044 throws PortalException {
045
046 return getRepositoryTrash().moveFileEntryToTrash(
047 userId, repositoryId, fileEntryId);
048 }
049
050 public static void restoreFileEntryFromTrash(
051 long userId, long repositoryId, long fileEntryId)
052 throws PortalException {
053
054 getRepositoryTrash().restoreFileEntryFromTrash(
055 userId, repositoryId, fileEntryId);
056 }
057
058 public void setRepositoryTrash(RepositoryTrash repositoryTrash) {
059 PortalRuntimePermission.checkSetBeanProperty(getClass());
060
061 _repositoryTrash = repositoryTrash;
062 }
063
064 private static RepositoryTrash _repositoryTrash;
065
066 }