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 */
016
017package org.ametys.plugins.repository.metadata;
018
019import java.io.InputStream;
020import java.io.OutputStream;
021import java.util.Date;
022
023import org.ametys.plugins.repository.AmetysRepositoryException;
024
025/**
026 * Resource that is modifiable
027 * @deprecated Use org.ametys.cms.data.Resource instead
028 */
029@Deprecated
030public interface ModifiableResource extends Resource
031{
032    /**
033     * Rename the current metadata
034     * @param newName the new name
035     * @throws AmetysRepositoryException if an error occurs.
036     */
037    public void rename(String newName) throws AmetysRepositoryException;
038    
039    /**
040     * Set the mime type.
041     * @param mimeType the mime type of the data.
042     * @throws AmetysRepositoryException if an error occurs.
043     */
044    public void setMimeType(String mimeType) throws AmetysRepositoryException;
045    
046    /**
047     * Returns an OuputStream to write the data stream.
048     * @return an OuputStream to write the data stream.
049     * @throws AmetysRepositoryException if an error occurs.
050     */
051    public OutputStream getOutputStream() throws AmetysRepositoryException;
052    
053    /**
054     * Set the data stream.
055     * @param stream the data stream.
056     * @throws AmetysRepositoryException if an error occurs.
057     */
058    public void setInputStream(InputStream stream) throws AmetysRepositoryException;
059    
060    /**
061     * Set the encoding if the data stream, if it is a character stream.
062     * @param encoding the encoding of the data stream.
063     * @throws AmetysRepositoryException if an error occurs.
064     */
065    public void setEncoding(String encoding) throws AmetysRepositoryException;
066
067    /**
068     * Set the last modification date.
069     * @param lastModifiedDate the last modification date.
070     * @throws AmetysRepositoryException if an error occurs.
071     */
072    public void setLastModified(Date lastModifiedDate) throws AmetysRepositoryException;
073}