001    /**
002     * Copyright (c) 2000-2013 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.exception.SystemException;
019    import com.liferay.portal.kernel.repository.model.FileEntry;
020    import com.liferay.portal.kernel.repository.model.FileVersion;
021    import com.liferay.portal.kernel.repository.model.Folder;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.io.File;
025    import java.io.InputStream;
026    
027    /**
028     * @author Alexander Chow
029     */
030    public interface LocalRepository {
031    
032            public FileEntry addFileEntry(
033                            long userId, long folderId, String sourceFileName, String mimeType,
034                            String title, String description, String changeLog, File file,
035                            ServiceContext serviceContext)
036                    throws PortalException, SystemException;
037    
038            public FileEntry addFileEntry(
039                            long userId, long folderId, String sourceFileName, String mimeType,
040                            String title, String description, String changeLog, InputStream is,
041                            long size, ServiceContext serviceContext)
042                    throws PortalException, SystemException;
043    
044            public Folder addFolder(
045                            long userId, long parentFolderId, String title, String description,
046                            ServiceContext serviceContext)
047                    throws PortalException, SystemException;
048    
049            public void deleteAll() throws PortalException, SystemException;
050    
051            public void deleteFileEntry(long fileEntryId)
052                    throws PortalException, SystemException;
053    
054            public void deleteFolder(long folderId)
055                    throws PortalException, SystemException;
056    
057            public FileEntry getFileEntry(long fileEntryId)
058                    throws PortalException, SystemException;
059    
060            public FileEntry getFileEntry(long folderId, String title)
061                    throws PortalException, SystemException;
062    
063            public FileEntry getFileEntryByUuid(String uuid)
064                    throws PortalException, SystemException;
065    
066            public FileVersion getFileVersion(long fileVersionId)
067                    throws PortalException, SystemException;
068    
069            public Folder getFolder(long folderId)
070                    throws PortalException, SystemException;
071    
072            public Folder getFolder(long parentFolderId, String title)
073                    throws PortalException, SystemException;
074    
075            public long getRepositoryId();
076    
077            public FileEntry moveFileEntry(
078                            long userId, long fileEntryId, long newFolderId,
079                            ServiceContext serviceContext)
080                    throws PortalException, SystemException;
081    
082            public Folder moveFolder(
083                            long userId, long folderId, long parentFolderId,
084                            ServiceContext serviceContext)
085                    throws PortalException, SystemException;
086    
087            public void updateAsset(
088                            long userId, FileEntry fileEntry, FileVersion fileVersion,
089                            long[] assetCategoryIds, String[] assetTagNames,
090                            long[] assetLinkEntryIds)
091                    throws PortalException, SystemException;
092    
093            public FileEntry updateFileEntry(
094                            long userId, long fileEntryId, String sourceFileName,
095                            String mimeType, String title, String description, String changeLog,
096                            boolean majorVersion, File file, ServiceContext serviceContext)
097                    throws PortalException, SystemException;
098    
099            public FileEntry updateFileEntry(
100                            long userId, long fileEntryId, String sourceFileName,
101                            String mimeType, String title, String description, String changeLog,
102                            boolean majorVersion, InputStream is, long size,
103                            ServiceContext serviceContext)
104                    throws PortalException, SystemException;
105    
106            public Folder updateFolder(
107                            long folderId, long parentFolderId, String title,
108                            String description, ServiceContext serviceContext)
109                    throws PortalException, SystemException;
110    
111    }