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.DownloadCommand;
021    import echopoint.tucana.DownloadProvider;
022    
023    /**
024     * A download event that indicates that a download request from the client
025     * failed (usually not due to user interaction).
026     *
027     * @author Rakesh 2008-11-11
028     * @version $Id: DownloadFailEvent.java 92 2008-11-11 19:49:44Z sptrakesh $
029     */
030    public class DownloadFailEvent extends DownloadEvent
031    {
032      private static final long serialVersionUID = 1l;
033    
034      /** The exception that was generated that indicates the cause of the failure. */
035      private final Exception exception;
036    
037      /**
038       * Constructs a new download event with the specified content attributes.
039       *
040       * @param source The object on which the Event initially occurred.
041       * @param provider The download provider that contains information about the
042       *   content that was downloaded.
043       * @param exception The cause of the failure.
044       * @throws IllegalArgumentException if source is null.
045       */
046      public DownloadFailEvent( final DownloadCommand source,
047          final DownloadProvider provider, final Exception exception )
048        throws IllegalArgumentException
049      {
050        super( source, provider.getFileName(), provider.getSize(),
051            provider.getContentDisposition() );
052        this.exception = exception;
053      }
054    
055      /**
056       * Accessor for property 'exception'.
057       *
058       * @return Value for property 'exception'.
059       */
060      public Exception getException()
061      {
062        return exception;
063      }
064    }