]> iEval git - fonbot.git/commitdiff
Drop Utils#parseHttpMessage
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 22 Mar 2013 11:22:38 +0000 (13:22 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 22 Mar 2013 11:22:38 +0000 (13:22 +0200)
The new modperl-based server does not send weird response messages, so the response message can be used without being transformed by this method.

src/ro/ieval/fonbot/HttpCallExecutableRunnable.java
src/ro/ieval/fonbot/Utils.java

index 469f27d9073853ca6f85ff83ecc046cbc526a89c..e95dba73ab478c02d5f94fa77e18ee996f4c918e 100644 (file)
@@ -201,7 +201,7 @@ public final class HttpCallExecutableRunnable extends ExecutableRunnable{
                        if(message==null && callback != null)
                                callback.onError(toNonNull(context.getString(no_response_returned_from_server)));
                        else if(message != null && callback != null)
-                               callback.onResult(conn.getResponseCode(), Utils.parseHttpMessage(message),
+                               callback.onResult(conn.getResponseCode(), message,
                                                toNonNull(conn.getInputStream()));
                        conn.disconnect();
                } catch (Exception e) {
index c6993562b049eca70ea8d2884ba4c7c02cdd5932..ddb506bfdbabe17d80e81b002742ad2604c5146b 100644 (file)
@@ -335,21 +335,6 @@ public final class Utils {
                }
        }
 
-       /**
-        * Parses a HTTP response message of the form <code>(part1) part2</code>, returning <code>part2</code>.
-        *
-        * @param message the raw HTTP response message
-        * @return the extracted part
-        */
-       public static String parseHttpMessage(final String message){
-               final int indexOfParen=message.indexOf(')');
-               if(indexOfParen==-1)
-                       return message;
-               if(indexOfParen == message.length()-1)
-                       return toNonNull(message.substring(1, indexOfParen));
-               return toNonNull(message.substring(indexOfParen+2));
-       }
-
        /**
         * Splits a string into words.
         *
This page took 0.020463 seconds and 4 git commands to generate.