View | Details | Raw Unified | Return to bug 57420
Collapse All | Expand All

(-)java/org/apache/naming/resources/DirContextURLConnection.java (-9 / +6 lines)
Lines 56-68 Link Here
56
 */
56
 */
57
public class DirContextURLConnection extends URLConnection {
57
public class DirContextURLConnection extends URLConnection {
58
58
59
    private static final UDecoder URL_DECODER = new UDecoder();
59
    private UDecoder urlDecoder = new UDecoder();
60
    private static final UEncoder URL_ENCODER = new UEncoder();
60
    private UEncoder urlEncoder = new UEncoder();
61
61
62
    static{
63
        URL_ENCODER.addSafeCharacter('/');
64
    }
65
66
    // ----------------------------------------------------------- Constructors
62
    // ----------------------------------------------------------- Constructors
67
63
68
    public DirContextURLConnection(DirContext context, URL url) {
64
    public DirContextURLConnection(DirContext context, URL url) {
Lines 72-79 Link Here
72
                ("Directory context can't be null");
68
                ("Directory context can't be null");
73
        if (org.apache.naming.Constants.IS_SECURITY_ENABLED) {
69
        if (org.apache.naming.Constants.IS_SECURITY_ENABLED) {
74
            this.permission = new JndiPermission(url.toString());
70
            this.permission = new JndiPermission(url.toString());
75
    }
71
        }
76
        this.context = context;
72
        this.context = context;
73
        urlEncoder.addSafeCharacter('/');
77
    }
74
    }
78
75
79
76
Lines 146-152 Link Here
146
143
147
            try {
144
            try {
148
                date = System.currentTimeMillis();
145
                date = System.currentTimeMillis();
149
                path = URL_DECODER.convert(getURL().getFile(), false);
146
                path = urlDecoder.convert(getURL().getFile(), false);
150
                if (context instanceof ProxyDirContext) {
147
                if (context instanceof ProxyDirContext) {
151
                    ProxyDirContext proxyDirContext =
148
                    ProxyDirContext proxyDirContext =
152
                        (ProxyDirContext) context;
149
                        (ProxyDirContext) context;
Lines 440-446 Link Here
440
                    NameClassPair ncp = enumeration.nextElement();
437
                    NameClassPair ncp = enumeration.nextElement();
441
                    String s = ncp.getName();
438
                    String s = ncp.getName();
442
                    result.addElement(
439
                    result.addElement(
443
                            URL_ENCODER.encodeURL(s, 0, s.length()).toString());
440
                            urlEncoder.encodeURL(s, 0, s.length()).toString());
444
                }
441
                }
445
            } catch (NamingException e) {
442
            } catch (NamingException e) {
446
                // Unexpected exception
443
                // Unexpected exception

Return to bug 57420