flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject git commit: [flex-utilities] [refs/heads/develop] - - Added a loop to the accept license part that loops as long as an unreadable answer (not yes/y or no/n) is entered and only aborts if the user selects no.
Date Fri, 10 Apr 2015 07:14:56 GMT
Repository: flex-utilities
Updated Branches:
  refs/heads/develop f21e5281f -> 07c77ee31


- Added a loop to the accept license part that loops as long as an unreadable answer (not
yes/y or no/n) is entered and only aborts if the user selects no.


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/07c77ee3
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/07c77ee3
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/07c77ee3

Branch: refs/heads/develop
Commit: 07c77ee31304498a89ec170af214d09e22acc55f
Parents: f21e528
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Fri Apr 10 09:14:50 2015 +0200
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Fri Apr 10 09:14:50 2015 +0200

----------------------------------------------------------------------
 .../retrievers/download/DownloadRetriever.java     | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/07c77ee3/mavenizer/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
----------------------------------------------------------------------
diff --git a/mavenizer/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
b/mavenizer/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
index 115898d..96e95ff 100644
--- a/mavenizer/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
+++ b/mavenizer/retrievers/download/src/main/java/org/apache/flex/utilities/converter/retrievers/download/DownloadRetriever.java
@@ -342,14 +342,19 @@ public class DownloadRetriever extends BaseRetriever {
         } else {
             throw new RetrieverException("Unknown SdkType");
         }
-        System.out.println(question);
-        System.out.print(questionProps.getProperty("DO_YOU_ACCEPT_QUESTION") + " ");
         final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
         try {
-            final String answer = reader.readLine();
-            if (!"YES".equalsIgnoreCase(answer)) {
-                System.out.println("You have to accept the license agreement in order to
proceed.");
-                throw new RetrieverException("You have to accept the license agreement in
order to proceed.");
+            while (true) {
+                System.out.println(question);
+                System.out.print(questionProps.getProperty("DO_YOU_ACCEPT_QUESTION") + "
");
+                final String answer = reader.readLine();
+                if ("YES".equalsIgnoreCase(answer) || "Y".equalsIgnoreCase(answer)) {
+                    return;
+                }
+                if ("NO".equalsIgnoreCase(answer) || "N".equalsIgnoreCase(answer)) {
+                    System.out.println("You have to accept the license agreement in order
to proceed.");
+                    throw new RetrieverException("You have to accept the license agreement
in order to proceed.");
+                }
             }
         } catch(IOException e) {
             throw new RetrieverException("Couldn't read from Stdin.");


Mime
View raw message