001/*
002 *  Copyright 2012 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.core.upload;
017
018import java.io.InputStream;
019import java.util.Date;
020
021/**
022 * Access to a file uploaded previously.
023 */
024public interface Upload
025{
026    /**
027     * Retrieves the upload id.
028     * @return the upload id.
029     */
030    String getId();
031    
032    /**
033     * Retrieves the uploaded date.
034     * @return the uploaded date.
035     */
036    Date getUploadedDate();
037    
038    /**
039     * Retrieves the filename.
040     * @return the filename.
041     */
042    String getFilename();
043
044    /**
045     * Retrieves the mime type.
046     * @return the mime type.
047     */
048    String getMimeType();
049
050    /**
051     * Retrieves the data length.
052     * @return the data length in bytes.
053     */
054    long getLength();
055    
056    /**
057     * Retrieves the input stream.<p>
058     * Each call will return a new {@link InputStream}.
059     * @return the input stream of the data.
060     */
061    InputStream getInputStream();
062}