#3 nedredmond

Отворени
nedredmond заяви обединяване на 1 ревизии от nedredmond/YouAreEll:master във master
променени са 9 файла, в които са добавени 292 реда и са изтрити 30 реда
  1. 16
    6
      Client/Client.iml
  2. 13
    0
      Client/pom.xml
  3. 48
    5
      Client/src/main/java/SimpleShell.java
  4. 87
    10
      Client/src/main/java/YouAreEll.java
  5. 31
    0
      Client/src/main/java/json_objects/Id.java
  6. 49
    0
      Client/src/main/java/json_objects/Message.java
  7. 4
    4
      README.md
  8. 13
    4
      YouAreEll.iml
  9. 31
    1
      pom.xml

+ 16
- 6
Client/Client.iml Целия файл

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4
     <output url="file://$MODULE_DIR$/target/classes" />
4
     <output url="file://$MODULE_DIR$/target/classes" />
5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
     <content url="file://$MODULE_DIR$">
6
     <content url="file://$MODULE_DIR$">
7
       <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
7
       <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9
-      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
8
+      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
10
       <excludeFolder url="file://$MODULE_DIR$/target" />
9
       <excludeFolder url="file://$MODULE_DIR$/target" />
11
     </content>
10
     </content>
12
     <orderEntry type="inheritedJdk" />
11
     <orderEntry type="inheritedJdk" />
13
     <orderEntry type="sourceFolder" forTests="false" />
12
     <orderEntry type="sourceFolder" forTests="false" />
14
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.6" level="project" />
15
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" />
16
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.6" level="project" />
13
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
14
+    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
15
+    <orderEntry type="library" name="Maven: com.mashape.unirest:unirest-java:1.4.9" level="project" />
16
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.7" level="project" />
17
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
18
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.7" level="project" />
19
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.3.6" level="project" />
20
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.3.3" level="project" />
21
+    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.3" level="project" />
22
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.6" level="project" />
23
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.0.2" level="project" />
24
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.3.2" level="project" />
25
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.3.6" level="project" />
26
+    <orderEntry type="library" name="Maven: org.json:json:20140107" level="project" />
17
   </component>
27
   </component>
18
 </module>
28
 </module>

+ 13
- 0
Client/pom.xml Целия файл

10
     <modelVersion>4.0.0</modelVersion>
10
     <modelVersion>4.0.0</modelVersion>
11
 
11
 
12
     <artifactId>Client</artifactId>
12
     <artifactId>Client</artifactId>
13
+    <dependencies>
14
+        <dependency>
15
+            <groupId>junit</groupId>
16
+            <artifactId>junit</artifactId>
17
+            <version>4.12</version>
18
+            <scope>test</scope>
19
+        </dependency>
20
+        <dependency>
21
+            <groupId>com.mashape.unirest</groupId>
22
+            <artifactId>unirest-java</artifactId>
23
+            <version>1.4.9</version>
24
+        </dependency>
25
+    </dependencies>
13
 
26
 
14
 
27
 
15
 </project>
28
 </project>

+ 48
- 5
Client/src/main/java/SimpleShell.java Целия файл

1
+import com.mashape.unirest.http.exceptions.UnirestException;
2
+import json_objects.Message;
3
+
1
 import java.io.BufferedReader;
4
 import java.io.BufferedReader;
2
 import java.io.IOException;
5
 import java.io.IOException;
3
 import java.io.InputStream;
6
 import java.io.InputStream;
4
 import java.io.InputStreamReader;
7
 import java.io.InputStreamReader;
5
 import java.util.ArrayList;
8
 import java.util.ArrayList;
9
+import java.util.Arrays;
6
 import java.util.List;
10
 import java.util.List;
7
 
11
 
8
 public class SimpleShell {
12
 public class SimpleShell {
20
                 (new InputStreamReader(System.in));
24
                 (new InputStreamReader(System.in));
21
 
25
 
22
         ProcessBuilder pb = new ProcessBuilder();
26
         ProcessBuilder pb = new ProcessBuilder();
23
-        List<String> history = new ArrayList<String>();
27
+        List<String> history = new ArrayList<>();
24
         int index = 0;
28
         int index = 0;
29
+
25
         //we break out with <ctrl c>
30
         //we break out with <ctrl c>
26
         while (true) {
31
         while (true) {
32
+
27
             //read what the user enters
33
             //read what the user enters
28
             System.out.println("cmd? ");
34
             System.out.println("cmd? ");
29
             commandLine = console.readLine();
35
             commandLine = console.readLine();
30
 
36
 
31
             //input parsed into array of strings(command and arguments)
37
             //input parsed into array of strings(command and arguments)
32
             String[] commands = commandLine.split(" ");
38
             String[] commands = commandLine.split(" ");
33
-            List<String> list = new ArrayList<String>();
39
+            List<String> list = new ArrayList<>();
34
 
40
 
35
             //if the user entered a return, just loop again
41
             //if the user entered a return, just loop again
36
             if (commandLine.equals(""))
42
             if (commandLine.equals(""))
46
                 list.add(commands[i]);
52
                 list.add(commands[i]);
47
 
53
 
48
             }
54
             }
55
+
49
             System.out.print(list); //***check to see if list was added correctly***
56
             System.out.print(list); //***check to see if list was added correctly***
50
             history.addAll(list);
57
             history.addAll(list);
58
+
51
             try {
59
             try {
52
                 //display history of shell with index
60
                 //display history of shell with index
53
                 if (list.get(list.size() - 1).equals("history")) {
61
                 if (list.get(list.size() - 1).equals("history")) {
66
                 }
74
                 }
67
 
75
 
68
                 // messages
76
                 // messages
69
-                if (list.contains("messages")) {
77
+                if (list.contains("messages") && list.size() == 2) {
78
+                    String results = "";
79
+                    try {
80
+                        results = webber.get_messages_id(list.get(1));
81
+                        } catch (Exception e) {
82
+                        System.out.println("Invalid ID. Try again.");
83
+                        }
84
+                    SimpleShell.prettyPrint(results);
85
+                    continue;
86
+                }
87
+
88
+                if (list.contains("messages") && list.size() == 1) {
70
                     String results = webber.get_messages();
89
                     String results = webber.get_messages();
71
                     SimpleShell.prettyPrint(results);
90
                     SimpleShell.prettyPrint(results);
72
                     continue;
91
                     continue;
73
                 }
92
                 }
93
+
94
+                if (list.contains("send")) {
95
+                    if (list.size() < 3) {
96
+                        System.out.println("Proper syntax is: send your_github_id 'Hello World'");
97
+                    } else {
98
+                        String toId = "";
99
+
100
+                        Message msg = new Message();
101
+                        msg.setMessage(getString(list));
102
+                        msg.setFromid(list.get(1));
103
+                        String results = webber.send_id_message(list.get(1), msg);
104
+                        SimpleShell.prettyPrint(results);
105
+                        continue;
106
+                    }
107
+                }
74
                 // you need to add a bunch more.
108
                 // you need to add a bunch more.
75
 
109
 
76
                 //!! command returns the last command in history
110
                 //!! command returns the last command in history
100
                     System.out.println(line);
134
                     System.out.println(line);
101
                 br.close();
135
                 br.close();
102
 
136
 
103
-
104
             }
137
             }
105
 
138
 
106
             //catch ioexception, output appropriate message, resume waiting for input
139
             //catch ioexception, output appropriate message, resume waiting for input
107
             catch (IOException e) {
140
             catch (IOException e) {
108
                 System.out.println("Input Error, Please try again!");
141
                 System.out.println("Input Error, Please try again!");
142
+            } catch (ClassNotFoundException e) {
143
+                e.printStackTrace();
144
+            } catch (UnirestException e) {
145
+                e.printStackTrace();
109
             }
146
             }
110
-            // So what, do you suppose, is the meaning of this comment?
147
+
148
+            // So what do you suppose is the meaning of this comment?
111
             /** The steps are:
149
             /** The steps are:
112
              * 1. parse the input to obtain the command and any parameters
150
              * 1. parse the input to obtain the command and any parameters
113
              * 2. create a ProcessBuilder object
151
              * 2. create a ProcessBuilder object
121
 
159
 
122
     }
160
     }
123
 
161
 
162
+    private static String getString(List<String> list) {
163
+        List<String> sublist = list.subList(2, list.size());
164
+        return String.join(" ", sublist);
165
+    }
166
+
124
 }
167
 }

+ 87
- 10
Client/src/main/java/YouAreEll.java Целия файл

1
+import com.fasterxml.jackson.core.JsonProcessingException;
2
+import com.fasterxml.jackson.core.type.TypeReference;
3
+import com.fasterxml.jackson.databind.ObjectMapper;
4
+import com.mashape.unirest.http.HttpResponse;
5
+import com.mashape.unirest.http.JsonNode;
6
+import com.mashape.unirest.http.Unirest;
7
+import com.mashape.unirest.http.exceptions.UnirestException;
8
+import json_objects.Id;
9
+import json_objects.Message;
10
+
11
+import java.io.IOException;
12
+import java.net.URL;
13
+import java.util.List;
14
+import java.util.stream.Stream;
15
+
1
 public class YouAreEll {
16
 public class YouAreEll {
2
 
17
 
18
+    ObjectMapper jacksonMapper = new ObjectMapper();
19
+
3
     YouAreEll() {
20
     YouAreEll() {
21
+        Unirest.setObjectMapper(new com.mashape.unirest.http.ObjectMapper() {
22
+            com.fasterxml.jackson.databind.ObjectMapper mapper
23
+                    = new com.fasterxml.jackson.databind.ObjectMapper();
24
+
25
+            public String writeValue(Object value) {
26
+                try {
27
+                    return mapper.writeValueAsString(value);
28
+                } catch (JsonProcessingException e) {
29
+                    e.printStackTrace();
30
+                }
31
+                return null;
32
+            }
33
+
34
+            public <T> T readValue(String value, Class<T> valueType) {
35
+                try {
36
+                    return mapper.readValue(value, valueType);
37
+                } catch (IOException e) {
38
+                    e.printStackTrace();
39
+                }
40
+                return null;
41
+            }
42
+        });
4
     }
43
     }
5
 
44
 
6
-    public static void main(String[] args) {
45
+    public static void main(String[] args) throws IOException, ClassNotFoundException {
7
         YouAreEll urlhandler = new YouAreEll();
46
         YouAreEll urlhandler = new YouAreEll();
8
-        System.out.println(urlhandler.MakeURLCall("/ids", "GET", ""));
9
-        System.out.println(urlhandler.MakeURLCall("/messages", "GET", ""));
47
+        System.out.println(urlhandler.get_ids());
48
+        System.out.println(urlhandler.get_messages());
49
+    }
50
+
51
+    public String get_ids() throws IOException, ClassNotFoundException {
52
+        return makeUrlCall("/ids", "GET", new TypeReference<List<Id>>(){});
53
+    }
54
+
55
+    public String get_messages() throws IOException, ClassNotFoundException {
56
+        return makeUrlCall("/messages", "GET", new TypeReference<List<Message>>(){});
57
+    }
58
+
59
+    public String get_messages_id(String id) throws IOException, ClassNotFoundException {
60
+        return makeUrlCall(String.format("/" + id + "/messages"), "GET", new TypeReference<List<Id>>(){});
61
+    }
62
+
63
+    public String send_id_message(String id, Message message) throws IOException, ClassNotFoundException, UnirestException {
64
+        return makePostCall(
65
+                String.format("/ids/" + id + "/messages"),
66
+                message
67
+        );
68
+    }
69
+
70
+    public String urlConcat(String mainurl) {
71
+        return "http://zipcode.rocks:8085" + mainurl;
10
     }
72
     }
11
 
73
 
12
-    public String get_ids() {
13
-        return MakeURLCall("/ids", "GET", "");
74
+    public String makeUrlCall(String mainurl, String method, TypeReference javaClass) throws IOException, ClassNotFoundException {
75
+        return makeGetCall(mainurl, javaClass);
14
     }
76
     }
15
 
77
 
16
-    public String get_messages() {
17
-        return MakeURLCall("/messages", "GET", "");
78
+    public String makeGetCall(String mainurl, TypeReference javaClass) throws ClassNotFoundException, IOException {
79
+        List<Object> results = jacksonMapper.readValue(new URL(urlConcat(mainurl)), javaClass);
80
+        System.out.println(jacksonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(javaClass));
81
+        return jacksonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(results);
18
     }
82
     }
19
 
83
 
20
-    public String MakeURLCall(String mainurl, String method, String jpayload) {
21
-        return "nada";
84
+    public String makePostCall(String mainurl, Message messsage) throws ClassNotFoundException, IOException, UnirestException {
85
+        HttpResponse<JsonNode> post = Unirest.post(urlConcat(mainurl))
86
+                .header("accept", "application/json")
87
+                .header("Content-Type", "application/json")
88
+                .body(messsage)
89
+                .asJson();
90
+        return jacksonMapper.writeValueAsString(messsage);
22
     }
91
     }
23
-}
92
+
93
+    public <T> Stream<T> makePayloadStream(String mainUrl, TypeReference javaClass) throws IOException {
94
+        List<T> results = jacksonMapper.readValue(new URL(urlConcat(mainUrl)), javaClass);
95
+        return results.stream();
96
+    }
97
+
98
+
99
+
100
+}

+ 31
- 0
Client/src/main/java/json_objects/Id.java Целия файл

1
+package json_objects;
2
+
3
+public class Id {
4
+    String userid;
5
+    String name;
6
+    String github;
7
+
8
+    public String getUserid() {
9
+        return userid;
10
+    }
11
+
12
+    public void setUserid(String userid) {
13
+        this.userid = userid;
14
+    }
15
+
16
+    public String getName() {
17
+        return name;
18
+    }
19
+
20
+    public void setName(String name) {
21
+        this.name = name;
22
+    }
23
+
24
+    public String getGithub() {
25
+        return github;
26
+    }
27
+
28
+    public void setGithub(String github) {
29
+        this.github = github;
30
+    }
31
+}

+ 49
- 0
Client/src/main/java/json_objects/Message.java Целия файл

1
+package json_objects;
2
+
3
+public class Message {
4
+    String sequence;
5
+    String timestamp;
6
+    String fromid;
7
+    String toid;
8
+    String message;
9
+
10
+    public String getSequence() {
11
+        return sequence;
12
+    }
13
+
14
+    public void setSequence(String sequence) {
15
+        this.sequence = sequence;
16
+    }
17
+
18
+    public String getTimestamp() {
19
+        return timestamp;
20
+    }
21
+
22
+    public void setTimestamp(String timestamp) {
23
+        this.timestamp = timestamp;
24
+    }
25
+
26
+    public String getFromid() {
27
+        return fromid;
28
+    }
29
+
30
+    public void setFromid(String fromid) {
31
+        this.fromid = fromid;
32
+    }
33
+
34
+    public String getToid() {
35
+        return toid;
36
+    }
37
+
38
+    public void setToid(String toid) {
39
+        this.toid = toid;
40
+    }
41
+
42
+    public String getMessage() {
43
+        return message;
44
+    }
45
+
46
+    public void setMessage(String message) {
47
+        this.message = message;
48
+    }
49
+}

+ 4
- 4
README.md Целия файл

19
 
19
 
20
 
20
 
21
 
21
 
22
-* You can send a message to the global timeline by POSTing a Message JSON object to the URL below.
22
+* You can send a message to the global timeline by POSTing a json_objects.Message JSON object to the URL below.
23
 	* If you leave the `to id` field empty, the message is `to the world`.
23
 	* If you leave the `to id` field empty, the message is `to the world`.
24
 	* If you fill out the the JSON template with a valid github_id in the `to id` field of the JSON payload, then that message is addressed to that friend.
24
 	* If you fill out the the JSON template with a valid github_id in the `to id` field of the JSON payload, then that message is addressed to that friend.
25
 	* Yes, all messages can be seen by users of the system.
25
 	* Yes, all messages can be seen by users of the system.
27
 
27
 
28
 
28
 
29
 
29
 
30
-* When you send a new Message or Id JSON object to the server, it records it, and fills in one or two fields. 
31
-	* A Message gets an assigned sequence number and a timestamp of when it was received by the server.
30
+* When you send a new json_objects.Message or json_objects.Id JSON object to the server, it records it, and fills in one or two fields. 
31
+	* A json_objects.Message gets an assigned sequence number and a timestamp of when it was received by the server.
32
 	* An ID object gets a "user id" field assigned to it.
32
 	* An ID object gets a "user id" field assigned to it.
33
 	* Any sequence number, timestamp or userid you put into a JSON template gets overwritten by the server when you POST it. 
33
 	* Any sequence number, timestamp or userid you put into a JSON template gets overwritten by the server when you POST it. 
34
 
34
 
95
  
95
  
96
 ## Messages
96
 ## Messages
97
 
97
 
98
-#### Message comands in shell
98
+#### json_objects.Message comands in shell
99
 in the shell
99
 in the shell
100
 * `messages` should return the last 20 messages, nicely formatted.
100
 * `messages` should return the last 20 messages, nicely formatted.
101
 * `messages your_github_id` should return the last 20 messages sent to you.
101
 * `messages your_github_id` should return the last 20 messages sent to you.

+ 13
- 4
YouAreEll.iml Целия файл

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4
     <output url="file://$MODULE_DIR$/target/classes" />
4
     <output url="file://$MODULE_DIR$/target/classes" />
5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
     <content url="file://$MODULE_DIR$">
6
     <content url="file://$MODULE_DIR$">
8
     </content>
8
     </content>
9
     <orderEntry type="inheritedJdk" />
9
     <orderEntry type="inheritedJdk" />
10
     <orderEntry type="sourceFolder" forTests="false" />
10
     <orderEntry type="sourceFolder" forTests="false" />
11
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.6" level="project" />
12
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" />
13
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.6" level="project" />
11
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.7" level="project" />
12
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
13
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.7" level="project" />
14
+    <orderEntry type="library" name="Maven: com.mashape.unirest:unirest-java:1.4.9" level="project" />
15
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.3.6" level="project" />
16
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.3.3" level="project" />
17
+    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.3" level="project" />
18
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.6" level="project" />
19
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.0.2" level="project" />
20
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.3.2" level="project" />
21
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.3.6" level="project" />
22
+    <orderEntry type="library" name="Maven: org.json:json:20140107" level="project" />
14
   </component>
23
   </component>
15
 </module>
24
 </module>

+ 31
- 1
pom.xml Целия файл

4
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
     <modelVersion>4.0.0</modelVersion>
5
     <modelVersion>4.0.0</modelVersion>
6
 
6
 
7
+    <properties>
8
+        <maven.compiler.source>1.8</maven.compiler.source>
9
+        <maven.compiler.target>1.8</maven.compiler.target>
10
+    </properties>
11
+
7
     <groupId>com.zipcoder.ZipChat</groupId>
12
     <groupId>com.zipcoder.ZipChat</groupId>
8
     <artifactId>YouAreEll</artifactId>
13
     <artifactId>YouAreEll</artifactId>
9
     <packaging>pom</packaging>
14
     <packaging>pom</packaging>
16
         <dependency>
21
         <dependency>
17
             <groupId>com.fasterxml.jackson.core</groupId>
22
             <groupId>com.fasterxml.jackson.core</groupId>
18
             <artifactId>jackson-databind</artifactId>
23
             <artifactId>jackson-databind</artifactId>
19
-            <version>2.8.6</version>
24
+            <version>2.9.7</version>
25
+        </dependency>
26
+        <dependency>
27
+            <groupId>com.mashape.unirest</groupId>
28
+            <artifactId>unirest-java</artifactId>
29
+            <version>1.4.9</version>
30
+        </dependency>
31
+        <dependency>
32
+            <groupId>org.apache.httpcomponents</groupId>
33
+            <artifactId>httpclient</artifactId>
34
+            <version>4.3.6</version>
35
+        </dependency>
36
+        <dependency>
37
+            <groupId>org.apache.httpcomponents</groupId>
38
+            <artifactId>httpasyncclient</artifactId>
39
+            <version>4.0.2</version>
40
+        </dependency>
41
+        <dependency>
42
+            <groupId>org.apache.httpcomponents</groupId>
43
+            <artifactId>httpmime</artifactId>
44
+            <version>4.3.6</version>
45
+        </dependency>
46
+        <dependency>
47
+            <groupId>org.json</groupId>
48
+            <artifactId>json</artifactId>
49
+            <version>20140107</version>
20
         </dependency>
50
         </dependency>
21
     </dependencies>
51
     </dependencies>
22
 </project>
52
 </project>