001
014
015 package com.liferay.portlet.documentlibrary.lar;
016
017 import com.liferay.portal.kernel.repository.model.Folder;
018 import com.liferay.portal.repository.liferayrepository.model.LiferayFolder;
019 import com.liferay.portlet.documentlibrary.NoSuchFolderException;
020 import com.liferay.portlet.documentlibrary.model.DLFolder;
021 import com.liferay.portlet.documentlibrary.service.persistence.DLFolderUtil;
022 import com.liferay.portlet.documentlibrary.util.RepositoryModelUtil;
023
024 import java.util.List;
025
026
029 public class FolderUtil {
030
031 public static Folder fetchByR_P_N(
032 long groupId, long parentFolderId, String name) {
033
034 DLFolder dlFolder = DLFolderUtil.fetchByG_P_N(
035 groupId, parentFolderId, name);
036
037 if (dlFolder == null) {
038 return null;
039 }
040
041 return new LiferayFolder(dlFolder);
042 }
043
044 public static Folder fetchByUUID_R(String uuid, long repositoryId) {
045 DLFolder dlFolder = DLFolderUtil.fetchByUUID_G(uuid, repositoryId);
046
047 if (dlFolder == null) {
048 return null;
049 }
050
051 return new LiferayFolder(dlFolder);
052 }
053
054 public static Folder findByPrimaryKey(long folderId)
055 throws NoSuchFolderException {
056
057 DLFolder dlFolder = DLFolderUtil.findByPrimaryKey(folderId);
058
059 return new LiferayFolder(dlFolder);
060 }
061
062
065 @Deprecated
066 public static List<Folder> findByR_P(
067 long repositoryId, long parentFolderId) {
068
069 List<DLFolder> dlFolders = DLFolderUtil.findByG_P(
070 repositoryId, parentFolderId);
071
072 return RepositoryModelUtil.toFolders(dlFolders);
073 }
074
075
078 @Deprecated
079 public static List<Folder> findByRepositoryId(long repositoryId) {
080 List<DLFolder> dlFolders = DLFolderUtil.findByGroupId(repositoryId);
081
082 return RepositoryModelUtil.toFolders(dlFolders);
083 }
084
085 }