KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > javadoc > httpfs > HTTPURLMapper


1 /**************************************************************************
2 *
3 * The contents of this file are subject to the terms of the Common Development
4 * and Distribution License (the License). You may not use this file except in
5 * compliance with the License.
6 *
7 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
8 * or http://www.netbeans.org/cddl.txt.
9 *
10 * When distributing Covered Code, include this CDDL Header Notice in each file
11 * and include the License file at http://www.netbeans.org/cddl.txt.
12 * If applicable, add the following below the CDDL Header, with the fields
13 * enclosed by brackets [] replaced by your own identifying information:
14 * "Portions Copyrighted [year] [name of copyright owner]"
15 *
16 * The Original Software is the HTTP Javadoc Filesystem.
17 * The Initial Developer of the Original Software is Jeffrey A. Keyser.
18 * Portions created by Jeffrey A. Keyser are Copyright (C) 2000-2002.
19 * All Rights Reserved.
20 *
21 * Contributor(s): Jeffrey A. Keyser.
22 *
23 **************************************************************************/

24
25
26 package org.netbeans.modules.javadoc.httpfs;
27
28 import java.net.URL JavaDoc;
29 import org.openide.filesystems.*;
30
31
32 /**
33  * <p>Represents an individual file found on the file sysetm.</p>
34  */

35 public class HTTPURLMapper
36     extends URLMapper {
37
38     /**
39      * Creates a new instance of HTTPURLMapper.
40      */

41     public HTTPURLMapper(
42     ) {
43
44         // Do nothing
45

46     }
47
48
49     /**
50      * Get an array of FileObjects for this url.
51      *
52      * @param fileURL URL for wanted FileObjects.
53      *
54      * @return Always null.
55      */

56     public FileObject[] getFileObjects(
57         URL JavaDoc fileURL
58     ) {
59
60         return null;
61
62     }
63
64
65     /**
66      * For HTTPFileObjects, returns the URL of the underlying file on requests
67      * for external or network URLs.
68      *
69      * @return URL for a file represented by the HTTPFileObject, or null.
70      */

71     public URL JavaDoc getURL(
72         FileObject file,
73         int urlType
74     ) {
75
76         // URL to return for this file
77
URL JavaDoc returnURL;
78
79
80         if( file instanceof HTTPFileObject && ( urlType == EXTERNAL || urlType == NETWORK ) ) {
81
82             returnURL = ((HTTPFileObject)file).fileURL;
83
84         } else {
85
86             returnURL = null;
87
88         }
89         return returnURL;
90
91     }
92
93 }
94
Popular Tags