001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.repository;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
019    
020    import java.util.List;
021    
022    /**
023     * @author Iv??n Zaera
024     */
025    public class RepositoryProviderUtil {
026    
027            public static LocalRepository getFileEntryLocalRepository(long fileEntryId)
028                    throws PortalException {
029    
030                    return getRepositoryProvider().getFileEntryLocalRepository(fileEntryId);
031            }
032    
033            public static Repository getFileEntryRepository(long fileEntryId)
034                    throws PortalException {
035    
036                    return getRepositoryProvider().getFileEntryRepository(fileEntryId);
037            }
038    
039            public static LocalRepository getFileShortcutLocalRepository(
040                            long fileShortcutId)
041                    throws PortalException {
042    
043                    return getRepositoryProvider().getFileShortcutLocalRepository(
044                            fileShortcutId);
045            }
046    
047            public static Repository getFileShortcutRepository(long fileShortcutId)
048                    throws PortalException {
049    
050                    return getRepositoryProvider().getFileShortcutRepository(
051                            fileShortcutId);
052            }
053    
054            public static LocalRepository getFileVersionLocalRepository(
055                            long fileVersionId)
056                    throws PortalException {
057    
058                    return getRepositoryProvider().getFileVersionLocalRepository(
059                            fileVersionId);
060            }
061    
062            public static Repository getFileVersionRepository(long fileVersionId)
063                    throws PortalException {
064    
065                    return getRepositoryProvider().getFileVersionRepository(fileVersionId);
066            }
067    
068            public static LocalRepository getFolderLocalRepository(long folderId)
069                    throws PortalException {
070    
071                    return getRepositoryProvider().getFolderLocalRepository(folderId);
072            }
073    
074            public static Repository getFolderRepository(long folderId)
075                    throws PortalException {
076    
077                    return getRepositoryProvider().getFolderRepository(folderId);
078            }
079    
080            public static List<LocalRepository> getGroupLocalRepositories(long groupId)
081                    throws PortalException {
082    
083                    return getRepositoryProvider().getGroupLocalRepositories(groupId);
084            }
085    
086            public static List<Repository> getGroupRepositories(long groupId)
087                    throws PortalException {
088    
089                    return getRepositoryProvider().getGroupRepositories(groupId);
090            }
091    
092            public static LocalRepository getImageLocalRepository(long imageId)
093                    throws PortalException {
094    
095                    return getRepositoryProvider().getImageLocalRepository(imageId);
096            }
097    
098            public static Repository getImageRepository(long imageId)
099                    throws PortalException {
100    
101                    return getRepositoryProvider().getImageRepository(imageId);
102            }
103    
104            public static LocalRepository getLocalRepository(long repositoryId)
105                    throws PortalException {
106    
107                    return getRepositoryProvider().getLocalRepository(repositoryId);
108            }
109    
110            public static Repository getRepository(long repositoryId)
111                    throws PortalException {
112    
113                    return getRepositoryProvider().getRepository(repositoryId);
114            }
115    
116            public static RepositoryProvider getRepositoryProvider() {
117                    PortalRuntimePermission.checkGetBeanProperty(RepositoryProvider.class);
118    
119                    return _repositoryProvider;
120            }
121    
122            public void setRepositoryProvider(RepositoryProvider repositoryProvider) {
123                    PortalRuntimePermission.checkSetBeanProperty(getClass());
124    
125                    _repositoryProvider = repositoryProvider;
126            }
127    
128            private static RepositoryProvider _repositoryProvider;
129    
130    }