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.explorer.resources;
017
018import java.io.InputStream;
019import java.util.Date;
020
021import org.ametys.core.user.UserIdentity;
022import org.ametys.plugins.repository.RemovableAmetysObject;
023import org.ametys.plugins.repository.dublincore.ModifiableDublinCoreAwareAmetysObject;
024import org.ametys.plugins.repository.lock.LockableAmetysObject;
025
026/**
027 * Interface representing a modifiable resource file of a resources explorer node.
028 */
029public interface ModifiableResource extends CommentableResource, ModifiableDublinCoreAwareAmetysObject, RemovableAmetysObject, LockableAmetysObject
030{
031    /**
032     * Set binary data.
033     * @param stream The {@link InputStream}.
034     * @param mimeType The file mimetype.
035     * @param lastModified The date of last modification.
036     * @param author The author of last modification.
037     */
038    public void setData(InputStream stream, String mimeType, Date lastModified, UserIdentity author);
039    
040    /**
041     * Set the creator of the resource
042     * @param creator The author
043     */
044    public void setCreator (UserIdentity creator);
045    
046    /**
047     * Set the last contributor of the resource
048     * @param lastContributor The last contributor
049     */
050    public void setLastContributor(UserIdentity lastContributor);
051    /**
052     * Set the last modified date if this resource.
053     * @param lastModified the last modified date.
054     */
055    public void setLastModified(Date lastModified);
056    /**
057     * Set the creation date if this resource.
058     * @param creationDate the creation date.
059     */
060    public void setCreationDate(Date creationDate);
061    
062    /**
063     * Set this resource's keywords.
064     * @param keywords the comma-separated keywords.
065     */
066    public void setKeywords(String keywords);
067    
068    /**
069     * Set this resource's keywords.
070     * @param keywords the keywords.
071     */
072    public void setKeywords(String[] keywords);
073    
074    /**
075     * Set this resource mime type.
076     * @param mimeType the mime type.
077     */
078    public void setMimeType(String mimeType);
079}