1 // Copyright (C) 2002 Jon A. Maxwell (JAM)
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
16 
17 package net.sourceforge.jnlp.event;
18 
19 import java.net.*;
20 import java.util.*;
21 
22 import net.sourceforge.jnlp.cache.*;
23 
24 /**
25  * This event is sent during the launch of an
26  * application.
27  *
28  * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
29  * @version $Revision: 1.3 $
30  */
31 public class DownloadEvent extends EventObject {
32 
33     /** the tracker */
34     final transient private ResourceTracker tracker;
35 
36     /** the resource */
37     final transient private Resource resource;
38 
39     /**
40      * Creates a launch event for the specified application
41      * instance.
42      *
43      * @param source the resource tracker
44      * @param resource the resource
45      */
DownloadEvent(ResourceTracker source, Resource resource)46     public DownloadEvent(ResourceTracker source, Resource resource) {
47         super(source);
48 
49         this.tracker = source;
50         this.resource = resource;
51     }
52 
53     /**
54      * @return the tracker that owns the resource.
55      */
getTracker()56     public ResourceTracker getTracker() {
57         return tracker;
58     }
59 
60     /**
61      * @return the location of the resource being downloaded.
62      */
getResourceLocation()63     public URL getResourceLocation() {
64         return resource.getLocation();
65     }
66 
67 }
68