KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > weblech > spider > URLToDownload


1 /*
2  * This is the MIT license, see also http://www.opensource.org/licenses/mit-license.html
3  *
4  * Copyright (c) 2001 Brian Pitcher
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */

24
25 // $Header: /cvsroot/weblech/weblech/src/weblech/spider/URLToDownload.java,v 1.2 2001/11/01 18:12:02 weblech Exp $
26

27 package weblech.spider;
28
29 import java.net.URL JavaDoc;
30
31 public class URLToDownload implements java.io.Serializable JavaDoc
32 {
33     private final URL JavaDoc url;
34     private final URL JavaDoc referer;
35     private final int depth;
36
37     public URLToDownload(URL JavaDoc url, int depth)
38     {
39         this(url, null, depth);
40     }
41
42     public URLToDownload(URL JavaDoc url, URL JavaDoc referer, int depth)
43     {
44         this.url = url;
45         this.referer = referer;
46         this.depth = depth;
47     }
48
49     public URL JavaDoc getURL()
50     {
51         return url;
52     }
53
54     public URL JavaDoc getReferer()
55     {
56         return referer;
57     }
58
59     public int getDepth()
60     {
61         return depth;
62     }
63
64     public String JavaDoc toString()
65     {
66         return url + ", referer " + referer + ", depth " + depth;
67     }
68 }
69
Popular Tags