src/java.management.rest/share/classes/com/oracle/jmx/remote/rest/http/MBeanServerResource.java
branchjmx-rest-api
changeset 56006 352a4f213fc6
parent 56002 60ab3b595a8e
equal deleted inserted replaced
56005:90cff2ac77b8 56006:352a4f213fc6
    48 import java.io.IOException;
    48 import java.io.IOException;
    49 import java.lang.reflect.InvocationHandler;
    49 import java.lang.reflect.InvocationHandler;
    50 import java.lang.reflect.Method;
    50 import java.lang.reflect.Method;
    51 import java.lang.reflect.Proxy;
    51 import java.lang.reflect.Proxy;
    52 import java.net.HttpURLConnection;
    52 import java.net.HttpURLConnection;
       
    53 import java.net.URLDecoder;
       
    54 import java.nio.charset.StandardCharsets;
    53 import java.security.AccessControlContext;
    55 import java.security.AccessControlContext;
    54 import java.security.AccessController;
    56 import java.security.AccessController;
    55 import java.security.PrivilegedAction;
    57 import java.security.PrivilegedAction;
    56 import java.util.Arrays;
    58 import java.util.Arrays;
    57 import java.util.LinkedHashMap;
    59 import java.util.LinkedHashMap;
   155             if (mBeansResource == null) {
   157             if (mBeansResource == null) {
   156                 throw new IllegalArgumentException("Invalid HTTP request Headers");
   158                 throw new IllegalArgumentException("Invalid HTTP request Headers");
   157             }
   159             }
   158         }
   160         }
   159 
   161 
   160         String path = exchange.getRequestURI().getPath();
   162         String path = URLDecoder.decode(exchange.getRequestURI().getPath(), StandardCharsets.UTF_8.displayName());
   161         String pathPrefix = httpContext.getPath();
   163         String pathPrefix = httpContext.getPath();
   162         // Route request to appropriate resource
   164         // Route request to appropriate resource
   163         if (path.matches(pathPrefix + "/?$")) {
   165         if (path.matches(pathPrefix + "/?$")) {
   164             RestResource.super.handle(exchange);
   166             RestResource.super.handle(exchange);
   165         } else if (path.matches(pathPrefix + "/mbeans.*")) {
   167         } else if (path.matches(pathPrefix + "/mbeans.*")) {