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.util;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.repository.model.FileEntry;
019    
020    import java.io.File;
021    import java.io.InputStream;
022    
023    /**
024     * @author     Sergio Gonz??lez
025     * @author     Matthew Kong
026     * @author     Alexander Chow
027     * @author     Iv??n Zaera
028     * @deprecated As of 7.0.0, replaced by {@link TempFileEntryUtil}
029     */
030    @Deprecated
031    public class TempFileUtil {
032    
033            public static FileEntry addTempFileEntry(
034                            long groupId, long userId, String fileName, String tempFolderName,
035                            File file, String mimeType)
036                    throws PortalException {
037    
038                    return TempFileEntryUtil.addTempFileEntry(
039                            groupId, userId, fileName, tempFolderName, file, mimeType);
040            }
041    
042            public static FileEntry addTempFileEntry(
043                            long groupId, long userId, String fileName, String tempFolderName,
044                            InputStream inputStream, String mimeType)
045                    throws PortalException {
046    
047                    return TempFileEntryUtil.addTempFileEntry(
048                            groupId, userId, fileName, tempFolderName, inputStream, mimeType);
049            }
050    
051            public static void deleteTempFileEntry(long fileEntryId)
052                    throws PortalException {
053    
054                    TempFileEntryUtil.deleteTempFileEntry(fileEntryId);
055            }
056    
057            public static void deleteTempFileEntry(
058                            long groupId, long userId, String folderName, String fileName)
059                    throws PortalException {
060    
061                    TempFileEntryUtil.deleteTempFileEntry(
062                            groupId, userId, folderName, fileName);
063            }
064    
065            public static FileEntry getTempFileEntry(
066                            long groupId, long userId, String folderName, String fileName)
067                    throws PortalException {
068    
069                    return TempFileEntryUtil.getTempFileEntry(
070                            groupId, userId, folderName, fileName);
071            }
072    
073            public static String[] getTempFileNames(
074                            long groupId, long userId, String folderName)
075                    throws PortalException {
076    
077                    return TempFileEntryUtil.getTempFileNames(groupId, userId, folderName);
078            }
079    
080    }