Sonar Fixes, Formatting
[aaf/authz.git] / auth / auth-cmd / src / main / java / org / onap / aaf / auth / cmd / perm / Grant.java
index f27a260..eb20697 100644 (file)
@@ -9,9 +9,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,7 +38,7 @@ import aaf.v2_0.Pkey;
 import aaf.v2_0.RolePermRequest;
 
 /**
- * 
+ *
  * @author Jonathan
  *
  */
@@ -52,7 +52,7 @@ public class Grant extends Cmd {
             new Param("instance",true),
             new Param("action",true),
             new Param("role[,role]*",false)
-            ); 
+            );
     }
 
     @Override
@@ -63,7 +63,7 @@ public class Grant extends Cmd {
                 int idx = index;
                 String action = args[idx++];
                 int option = whichOption(options, action);
-        
+
                 RolePermRequest rpr = new RolePermRequest();
                 Pkey pk = new Pkey();
                 pk.setType(args[idx++]);
@@ -71,9 +71,9 @@ public class Grant extends Cmd {
                 pk.setAction(args[idx++]);
                 rpr.setPerm(pk);
                 setStartEnd(rpr);
-                
+
                 Future<RolePermRequest> frpr = null;
-        
+
                 String[] roles = args[idx++].split(",");
                 String strA;
                 String strB;
@@ -83,7 +83,7 @@ public class Grant extends Cmd {
                         // You can request to Grant Permission to a Role
                         setQueryParamsOn(client);
                         frpr = client.create(
-                                "/authz/role/perm", 
+                                "/authz/role/perm",
                                 getDF(RolePermRequest.class),
                                 rpr
                                 );
@@ -93,7 +93,7 @@ public class Grant extends Cmd {
                         // You can request to UnGrant Permission to a Role
                         setQueryParamsOn(client);
                         frpr = client.delete(
-                                "/authz/role/" + role + "/perm", 
+                                "/authz/role/" + role + "/perm",
                                 getDF(RolePermRequest.class),
                                 rpr
                                 );
@@ -101,7 +101,7 @@ public class Grant extends Cmd {
                         strB = "] from Role [";
                     }
                     if (frpr.get(AAFcli.timeout())) {
-                        pw().println(strA + pk.getType() + '|' + pk.getInstance() + '|' + pk.getAction() 
+                        pw().println(strA + pk.getType() + '|' + pk.getInstance() + '|' + pk.getAction()
                                 + strB + role +']');
                     } else {
                         if (frpr.code()==202) {
@@ -111,7 +111,7 @@ public class Grant extends Cmd {
                         } else {
                             error(frpr);
                             idx=Integer.MAX_VALUE;
-                        }            
+                        }
                     }
                 }
                 return frpr==null?0:frpr.code();