syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/2] syncope git commit: [SYNCOPE-985] Paths now working on Windows
Date Tue, 27 Dec 2016 16:08:57 GMT
[SYNCOPE-985] Paths now working on Windows


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/aef68d91
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/aef68d91
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/aef68d91

Branch: refs/heads/master
Commit: aef68d91f48ec1c204b52df199cc21fcc9f9aa8f
Parents: a6275ca
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Dec 27 17:08:30 2016 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Dec 27 17:08:42 2016 +0100

----------------------------------------------------------------------
 .../org/apache/syncope/client/cli/Input.java    | 22 ++++++++++----------
 .../configuration/ConfigurationUpdate.java      |  2 +-
 .../cli/commands/logger/LoggerCreate.java       |  2 +-
 .../cli/commands/logger/LoggerUpdate.java       |  2 +-
 .../commands/user/UserDeleteByAttribute.java    |  2 +-
 .../commands/user/UserSearchByAttribute.java    |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/aef68d91/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java b/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java
index 6721aa5..35b580f 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java
@@ -27,14 +27,22 @@ import org.apache.syncope.client.cli.util.CommandUtils;
 
 public class Input {
 
-    private final AbstractCommand command;
+    public static Pair<String, String> toPairParameter(final String parameter) throws
IllegalArgumentException {
+        if (!parameter.contains("=")) {
+            throw new IllegalArgumentException("Parameter syntax error!");
+        }
+        final String[] pairParameterArray = parameter.split("=");
+        return Pair.of(pairParameterArray[0], pairParameterArray[1]);
+    }
 
-    private String option;
+    private final AbstractCommand command;
 
     private final String[] parameters;
 
     private final List<String> commandFields = new ArrayList<>();
 
+    private String option;
+
     public Input(final String[] args)
             throws InstantiationException, IllegalAccessException, IllegalArgumentException
{
 
@@ -49,7 +57,7 @@ public class Input {
         if (args.length > 2) {
             parameters = new String[args.length - 2];
             for (int i = 0; i < parameters.length; i++) {
-                parameters[i] = args[i + 2].replaceAll("\\\\", "");
+                parameters[i] = args[i + 2];
                 commandFields.add(parameters[i]);
             }
         } else {
@@ -97,14 +105,6 @@ public class Input {
         return parameters.length;
     }
 
-    public Pair<String, String> toPairParameter(final String parameter) throws IllegalArgumentException
{
-        if (!parameter.contains("=")) {
-            throw new IllegalArgumentException("Parameter syntax error!");
-        }
-        final String[] pairParameterArray = parameter.split("=");
-        return Pair.of(pairParameterArray[0], pairParameterArray[1]);
-    }
-
     public String printCommandFields() {
         final StringBuilder commandBuilder = new StringBuilder();
         for (final String commandField : commandFields) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/aef68d91/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
index 4ddd050..91ef4c6 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
@@ -45,7 +45,7 @@ public class ConfigurationUpdate extends AbstractConfigurationCommand {
             LinkedList<AttrTO> attrList = new LinkedList<>();
             boolean failed = false;
             for (String parameter : input.getParameters()) {
-                Pair<String, String> pairParameter = input.toPairParameter(parameter);
+                Pair<String, String> pairParameter = Input.toPairParameter(parameter);
                 try {
                     AttrTO attrTO = configurationSyncopeOperations.get(pairParameter.getKey());
                     attrTO.getValues().clear();

http://git-wip-us.apache.org/repos/asf/syncope/blob/aef68d91/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
index 401a928..38e97d8 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
@@ -48,7 +48,7 @@ public class LoggerCreate extends AbstractLoggerCommand {
             boolean failed = false;
             for (String parameter : input.getParameters()) {
                 LoggerTO loggerTO = new LoggerTO();
-                Pair<String, String> pairParameter = input.toPairParameter(parameter);
+                Pair<String, String> pairParameter = Input.toPairParameter(parameter);
                 try {
                     loggerTO.setKey(pairParameter.getKey());
                     loggerTO.setLevel(LoggerLevel.valueOf(pairParameter.getValue()));

http://git-wip-us.apache.org/repos/asf/syncope/blob/aef68d91/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerUpdate.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerUpdate.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerUpdate.java
index 64bbde1..400cef3 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerUpdate.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerUpdate.java
@@ -47,7 +47,7 @@ public class LoggerUpdate extends AbstractLoggerCommand {
             final LinkedList<LoggerTO> loggerTOs = new LinkedList<>();
             boolean failed = false;
             for (String parameter : input.getParameters()) {
-                Pair<String, String> pairParameter = input.toPairParameter(parameter);
+                Pair<String, String> pairParameter = Input.toPairParameter(parameter);
                 try {
                     LoggerTO loggerTO = loggerSyncopeOperations.read(pairParameter.getKey());
                     loggerTO.setLevel(LoggerLevel.valueOf(pairParameter.getValue()));

http://git-wip-us.apache.org/repos/asf/syncope/blob/aef68d91/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDeleteByAttribute.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDeleteByAttribute.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDeleteByAttribute.java
index 38e4782..3759656 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDeleteByAttribute.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDeleteByAttribute.java
@@ -43,7 +43,7 @@ public class UserDeleteByAttribute extends AbstractUserCommand {
     public void delete() {
         if (input.parameterNumber() == 2) {
             String realm = input.firstParameter();
-            Pair<String, String> pairParameter = input.toPairParameter(input.secondParameter());
+            Pair<String, String> pairParameter = Input.toPairParameter(input.secondParameter());
             try {
                 if (!realmSyncopeOperations.exists(realm)) {
                     userResultManager.notFoundError("Realm", realm);

http://git-wip-us.apache.org/repos/asf/syncope/blob/aef68d91/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java
index 4181f83..92dc52b 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java
@@ -42,7 +42,7 @@ public class UserSearchByAttribute extends AbstractUserCommand {
     public void search() {
         if (input.parameterNumber() == 2) {
             String realm = input.firstParameter();
-            Pair<String, String> pairParameter = input.toPairParameter(input.secondParameter());
+            Pair<String, String> pairParameter = Input.toPairParameter(input.secondParameter());
             try {
                 if (!realmSyncopeOperations.exists(realm)) {
                     userResultManager.genericMessage(


Mime
View raw message