001    /**
002     * Copyright (c) 2000-2012 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.portlet.documentlibrary.util;
016    
017    import com.liferay.portal.kernel.repository.model.FileEntry;
018    import com.liferay.portal.kernel.repository.model.FileVersion;
019    
020    import java.io.InputStream;
021    
022    import java.util.Set;
023    
024    /**
025     * @author Sergio González
026     */
027    public interface ImageProcessor {
028    
029            public void cleanUp(FileEntry fileEntry);
030    
031            public void cleanUp(FileVersion fileVersion);
032    
033            public void generateImages(FileVersion fileVersion);
034    
035            public Set<String> getImageMimeTypes();
036    
037            public InputStream getThumbnailAsStream(
038                            FileVersion fileVersion, int thumbnailIndex)
039                    throws Exception;
040    
041            public long getThumbnailFileSize(
042                            FileVersion fileVersion, int thumbnailIndex)
043                    throws Exception;
044    
045            public boolean hasImages(FileVersion fileVersion);
046    
047            public boolean isImageSupported(FileVersion fileVersion);
048    
049            public boolean isImageSupported(String mimeType);
050    
051            public boolean isSupported(String mimeType);
052    
053            public void storeThumbnail(
054                            long companyId, long groupId, long fileEntryId, long fileVersionId,
055                            long custom1ImageId, long custom2ImageId,
056                            InputStream is, String type)
057                    throws Exception;
058    
059            public void trigger(FileVersion fileVersion);
060    
061    }