001    /*
002     * This file is part of the Echo Point Project.  This project is a
003     * collection of Components that have extended the Echo Web Application
004     * Framework Version 3.
005     *
006     * Version: MPL 1.1
007     *
008     * The contents of this file are subject to the Mozilla Public License Version
009     * 1.1 (the "License"); you may not use this file except in compliance with
010     * the License. You may obtain a copy of the License at
011     * http://www.mozilla.org/MPL/
012     *
013     * Software distributed under the License is distributed on an "AS IS" basis,
014     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
015     * for the specific language governing rights and limitations under the
016     * License.
017     */
018    package echopoint.tucana.event;
019    
020    import echopoint.tucana.FileUploadSelector;
021    import echopoint.tucana.UploadProgress;
022    
023    /**
024     * An event indicating that a file upload has progressed.
025     *
026     * <p><b>Note:</b> Development of this component was sponsored by <a
027     * href='http://tcnbroadcasting.com/index.jsp' target='_top'>TCN
028     * Broadcasting</a>.  We are grateful for their support and sponsorship.</p>
029     *
030     * @author Rakesh Vidyadharan 2008-11-4
031     * @version $Id: UploadProgressEvent.java 90 2008-11-11 01:41:05Z sptrakesh $
032     */
033    public class UploadProgressEvent extends UploadEvent
034    {
035      private static final long serialVersionUID = 1l;
036    
037      /** The progress object that encapsulates the file upload progress. */
038      private final UploadProgress progress;
039    
040      /**
041       * Short form of the constructor that populates only the mandatory fields.
042       *
043       * @param source the source of the event
044       * @param index the index of the upload
045       * @param progress The progress of the file upload.
046       */
047      public UploadProgressEvent( final FileUploadSelector source,
048          final String index, final UploadProgress progress )
049      {
050        this( source, index, null, null, progress );
051      }
052    
053      /**
054       * Creates a new {@link UploadEvent}.  This is the designated constructor.
055       *
056       * @param source the source of the event
057       * @param index the index of the upload
058       * @param fileName the name of the file, may not contain path information
059       * @param contentType the content type of the uploaded file
060       * @param progress The progress of the file upload.
061       */
062      public UploadProgressEvent( final FileUploadSelector source,
063          final String index, final String fileName,
064          final String contentType, final UploadProgress progress )
065      {
066        super( source, index, fileName, contentType );
067        this.progress = progress;
068      }
069    
070      /**
071       * Returns the progress of the file upload.
072       *
073       * @return the progress of the file upload.
074       */
075      public UploadProgress getProgress()
076      {
077        return progress;
078      }
079    }