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 void updateAsset(
083                            long userId, FileEntry fileEntry, FileVersion fileVersion,
084                            long[] assetCategoryIds, String[] assetTagNames,
085                            long[] assetLinkEntryIds)
086                    throws PortalException, SystemException;
087    
088            public FileEntry updateFileEntry(
089                            long userId, long fileEntryId, String sourceFileName,
090                            String mimeType, String title, String description, String changeLog,
091                            boolean majorVersion, File file, ServiceContext serviceContext)
092                    throws PortalException, SystemException;
093    
094            public FileEntry updateFileEntry(
095                            long userId, long fileEntryId, String sourceFileName,
096                            String mimeType, String title, String description, String changeLog,
097                            boolean majorVersion, InputStream is, long size,
098                            ServiceContext serviceContext)
099                    throws PortalException, SystemException;
100    
101            public Folder updateFolder(
102                            long folderId, long parentFolderId, String title,
103                            String description, ServiceContext serviceContext)
104                    throws PortalException, SystemException;
105    
106    }