001/*
002 *  Copyright 2010 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.plugins.repository.metadata;
017
018import java.io.InputStream;
019import java.util.Date;
020
021import org.ametys.plugins.repository.AmetysRepositoryException;
022
023/**
024 * Interface representing a binary resource.
025 * @deprecated Use org.ametys.cms.data.Resource instead
026 */
027@Deprecated
028public interface Resource
029{
030    /**
031     * Returns the data mime-type.
032     * @return the data mime-type.
033     * @throws AmetysRepositoryException if an error occurs.
034     */
035    public String getMimeType() throws AmetysRepositoryException;
036    
037    /**
038     * Returns the data stream.
039     * @return the data stream.
040     * @throws AmetysRepositoryException if an error occurs.
041     */
042    public InputStream getInputStream() throws AmetysRepositoryException;
043    
044    /**
045     * Returns the length of the data stream.
046     * @return the length of the data stream.
047     * @throws AmetysRepositoryException if an error occurs.
048     */
049    public long getLength() throws AmetysRepositoryException;
050        
051    /**
052     * Returns the encoding if the data stream, if it is a character stream.
053     * @return the encoding if the data stream or <code>null</code> if not available.
054     * @throws AmetysRepositoryException if an error occurs.
055     */
056    public String getEncoding() throws AmetysRepositoryException;
057    
058    /**
059     * Returns the last modification date.
060     * @return the last modification date.
061     * @throws AmetysRepositoryException if an error occurs.
062     */
063    public Date getLastModified() throws AmetysRepositoryException;
064}