@@ -0,0 +1,1931 @@
+/**%0A * Copyright (C) 2016 Joshua Auerbach %0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage test;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.File;%0Aimport java.io.InputStream;%0Aimport java.io.InputStreamReader;%0A%0Aimport org.apache.http.HttpEntity;%0Aimport org.apache.http.HttpResponse;%0Aimport org.apache.http.HttpStatus;%0Aimport org.apache.http.client.HttpClient;%0Aimport org.apache.http.client.methods.HttpPost;%0Aimport org.apache.http.entity.FileEntity;%0Aimport org.apache.http.impl.client.HttpClients;%0A%0A/**%0A * Just a test that we are able to communicate with the EncodingService at localhost:9879%0A */%0Apublic class TestEncodingService %7B%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A%09%09FileEntity entity = new FileEntity(new File(args%5B0%5D));%0A%09%09HttpClient client = HttpClients.createDefault();%0A%09%09HttpPost post = new HttpPost(%22http://localhost:9879%22);%0A%09%09entity.setContentType(%22text/plain%22);%0A%09%09post.setEntity(entity);%0A%09%09HttpResponse resp = client.execute(post);%0A%09%09int code = resp.getStatusLine().getStatusCode();%0A%09%09if (code == HttpStatus.SC_OK) %7B%0A%09%09%09HttpEntity answer = resp.getEntity();%0A%09%09%09InputStream s = answer.getContent();%0A%09%09%09BufferedReader rdr = new BufferedReader(new InputStreamReader(s));%0A%09%09%09String line = rdr.readLine();%0A%09%09%09while (line != null) %7B%0A%09%09%09%09System.out.println(line);%0A%09%09%09%09line = rdr.readLine();%0A%09%09%09%7D%0A%09%09%09rdr.close();%0A%09%09%09s.close();%0A%09%09%7D else%0A%09%09%09System.out.println(resp.getStatusLine());%0A%09%7D%0A%7D%0A

Add Java test for encoding service (only for testing).