Lines 24-30
Link Here
|
24 |
* Contributor(s): |
24 |
* Contributor(s): |
25 |
* |
25 |
* |
26 |
* The Original Software is NetBeans. The Initial Developer of the Original |
26 |
* The Original Software is NetBeans. The Initial Developer of the Original |
27 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun |
27 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun |
28 |
* Microsystems, Inc. All Rights Reserved. |
28 |
* Microsystems, Inc. All Rights Reserved. |
29 |
* |
29 |
* |
30 |
* If you wish your version of this file to be governed by only the CDDL |
30 |
* If you wish your version of this file to be governed by only the CDDL |
Lines 42-47
Link Here
|
42 |
package org.netbeans.modules.url; |
42 |
package org.netbeans.modules.url; |
43 |
|
43 |
|
44 |
import java.io.IOException; |
44 |
import java.io.IOException; |
|
|
45 |
import org.netbeans.spi.queries.FileEncodingQueryImplementation; |
45 |
import org.openide.filesystems.FileObject; |
46 |
import org.openide.filesystems.FileObject; |
46 |
import org.openide.loaders.DataObjectExistsException; |
47 |
import org.openide.loaders.DataObjectExistsException; |
47 |
import org.openide.loaders.ExtensionList; |
48 |
import org.openide.loaders.ExtensionList; |
Lines 60-65
Link Here
|
60 |
static final long serialVersionUID =-7407252842873642582L; |
61 |
static final long serialVersionUID =-7407252842873642582L; |
61 |
/** MIME-type of URL files */ |
62 |
/** MIME-type of URL files */ |
62 |
private static final String URL_MIME_TYPE = "text/url"; //NOI18N |
63 |
private static final String URL_MIME_TYPE = "text/url"; //NOI18N |
|
|
64 |
/** */ |
65 |
private static final String PROP_ENCODING_QUERY_IMPL |
66 |
= "org.netbeans.modules.url.encoding"; //NOI18N |
63 |
|
67 |
|
64 |
|
68 |
|
65 |
/** Creates a new URLDataLoader without the extension. */ |
69 |
/** Creates a new URLDataLoader without the extension. */ |
Lines 67-72
Link Here
|
67 |
super("org.netbeans.modules.url.URLDataObject"); //NOI18N |
71 |
super("org.netbeans.modules.url.URLDataObject"); //NOI18N |
68 |
} |
72 |
} |
69 |
|
73 |
|
|
|
74 |
/** |
75 |
* Returns an instance of {@code FileEncodingQueryImplementation} |
76 |
* representing encoding to be used by {@code URLDataObject}s. |
77 |
* |
78 |
* @return an instance of {@code FileEncodingQueryImplementation}, |
79 |
* or {@code null} if encoding UTF-8 is not supported |
80 |
*/ |
81 |
FileEncodingQueryImplementation getEncoding() { |
82 |
return (FileEncodingQueryImplementation) |
83 |
getProperty(PROP_ENCODING_QUERY_IMPL); |
84 |
} |
70 |
|
85 |
|
71 |
/** |
86 |
/** |
72 |
* Initializes this loader. This method is called only once the first time |
87 |
* Initializes this loader. This method is called only once the first time |
Lines 80-85
Link Here
|
80 |
ext.addMimeType(URL_MIME_TYPE); |
95 |
ext.addMimeType(URL_MIME_TYPE); |
81 |
ext.addMimeType("text/x-url"); //NOI18N |
96 |
ext.addMimeType("text/x-url"); //NOI18N |
82 |
setExtensions(ext); |
97 |
setExtensions(ext); |
|
|
98 |
|
99 |
try { |
100 |
putProperty(PROP_ENCODING_QUERY_IMPL, new EncodingQueryImpl()); |
101 |
} catch (IllegalArgumentException ex) { |
102 |
assert false; //this should not happen |
103 |
/* UTF-8 is not supported - use the project's default encoding */ |
104 |
} |
83 |
} |
105 |
} |
84 |
|
106 |
|
85 |
/** */ |
107 |
/** */ |