Authz unit test and code cleanup
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / authz / impl / AuthzResource.java
index 0357fa7..c248468 100644 (file)
@@ -30,7 +30,6 @@ import java.util.regex.Pattern;
 /** Internal representation of an authorization resource (the entity to which access is being requested).  Consists\r
  * of a type and an identifier.   The constructor takes the request URI from an HTTP request and checks it against\r
  * patterns for the the different resource types.  In DR R1, there are four resource types:\r
- * <ul>\r
  * <li>the feeds collection resource, the target of POST requests to create a new feed and GET requests to list\r
  * the existing feeds.  This is the root resource for the DR provisioning system, and it has no explicit id.\r
  * </li>\r
@@ -53,10 +52,10 @@ public class AuthzResource {
     private String id = "";\r
 \r
     /* Construct an AuthzResource by matching a request URI against the various patterns */\r
-    public AuthzResource(String rURI) {\r
-        if (rURI != null) {\r
+    AuthzResource(String requestUri) {\r
+        if (requestUri != null) {\r
             for (ResourceType t : ResourceType.values()) {\r
-                Matcher m = t.getPattern().matcher(rURI);\r
+                Matcher m = t.getPattern().matcher(requestUri);\r
                 if (m.find(0)) {\r
                     this.type = t;\r
                     if (m.group("id") != null) {\r
@@ -83,13 +82,13 @@ public class AuthzResource {
      */\r
     public enum ResourceType {\r
         FEEDS_COLLECTION("((://[^/]+/)|(^/))(?<id>)$"),\r
-        SUBS_COLLECTION ("((://[^/]+/)|(^/{0,1}))subscribe/(?<id>[^/]+)$"),\r
+        SUBS_COLLECTION("((://[^/]+/)|(^/{0,1}))subscribe/(?<id>[^/]+)$"),\r
         FEED("((://[^/]+/)|(^/{0,1}))feed/(?<id>[^/]+)$"),\r
         SUB("((://[^/]+/)|(^/{0,1}))subs/(?<id>[^/]+)$");\r
 \r
         private Pattern uriPattern;\r
 \r
-        private ResourceType(String patternString) {\r
+        ResourceType(String patternString) {\r
             this.uriPattern = Pattern.compile(patternString);\r
         }\r
 \r