<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,6 @@ package org.allmydata.tahoelafs;
 
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -12,21 +11,15 @@ import java.nio.ByteBuffer;
 import java.nio.channels.Channels;
 import java.nio.channels.ReadableByteChannel;
 import java.nio.channels.WritableByteChannel;
-import java.security.KeyStore;
-
 import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLSocketFactory;
-
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPut;
-import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.entity.FileEntity;
 import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.protocol.HttpContext;
 import org.json.JSONArray;
 import org.json.JSONException;
 
@@ -35,7 +28,13 @@ import android.util.Log;
 public class RESTClient {
 	private static String TAG = &quot;org.allmydata.tahoelafs.RESTClient&quot;;
 
-	public static String get(String url) {
+	private HttpClient httpclient;
+	
+	public RESTClient() {
+		httpclient = new DefaultHttpClient();
+	}
+	
+	public String get(String url) {
 		InputStream instream = openURL(url);
 		String result = convertStreamToString(instream);
 		Log.i(TAG, &quot;Result of conversion: [&quot; + result + &quot;]&quot;);
@@ -49,18 +48,17 @@ public class RESTClient {
 		}
 	}
 	
-	public static void put(String url, String filename) throws Exception {
+	public void put(String url, String filename) throws Exception {
 		Log.i(TAG, &quot;PUT &quot; + url);
 		
-		HttpClient client = new DefaultHttpClient();
 		HttpPut put = new HttpPut(url);
 		put.setEntity(new FileEntity(new File(filename), &quot;text/plain&quot;));
-		HttpResponse response = client.execute(put);
+		HttpResponse response = httpclient.execute(put);
 		
 		Log.i(TAG, &quot;Status:[&quot; + response.getStatusLine().toString() + &quot;]&quot;);
 	}
 
-	public static void download(String url, String dst) throws IOException {
+	public void download(String url, String dst) throws IOException {
 		Log.i(TAG, &quot;Downloading &quot; + url + &quot; to &quot; + dst);
 
 		Log.d(TAG, &quot;Opening url &quot; + url);
@@ -85,7 +83,7 @@ public class RESTClient {
 		out.close();
 	}
 
-	public static JSONArray getJSON(String url) {
+	public JSONArray getJSON(String url) {
 		String result = get(url);
 		try {
 			JSONArray json = new JSONArray(result);
@@ -131,8 +129,7 @@ public class RESTClient {
 		return sb.toString();
 	}
 
-	private static InputStream openURL(String url) {
-		HttpClient httpclient = new DefaultHttpClient();
+	private InputStream openURL(String url) {
 		HttpGet httpget = new HttpGet(url);
 		HttpResponse response;
 </diff>
      <filename>src/org/allmydata/tahoelafs/RESTClient.java</filename>
    </modified>
    <modified>
      <diff>@@ -6,21 +6,23 @@ import org.json.JSONArray;
 public class TahoeClient {
 	private static String TAG = &quot;TahoeClient&quot;;
 	private String node;
+	private RESTClient rest;
 	
 	public TahoeClient(String url) {
 		node = url;
+		rest = new RESTClient();
 	}
 	
 	public void uploadFile(String dir, String filename, String src) throws Exception {
-		RESTClient.put(node + &quot;/uri/&quot; + dir + &quot;/&quot; + filename, src);
+		rest.put(node + &quot;/uri/&quot; + dir + &quot;/&quot; + filename, src);
 	}
 	
 	public void downloadFile(String cap, String dst) throws IOException {
-		RESTClient.download(node + &quot;/uri/&quot; + cap, dst);
+		rest.download(node + &quot;/uri/&quot; + cap, dst);
 	}
 	
 	public TahoeDirectory getDirectory(String cap) throws Exception {
-		JSONArray json = RESTClient.getJSON(node + &quot;/uri/&quot; + cap + &quot;/?t=json&quot;);
+		JSONArray json = rest.getJSON(node + &quot;/uri/&quot; + cap + &quot;/?t=json&quot;);
 		return new TahoeDirectory(json);	
 	}
 }</diff>
      <filename>src/org/allmydata/tahoelafs/TahoeClient.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>899b8cabf4378e0083b08646c56975115b0be91e</id>
    </parent>
  </parents>
  <author>
    <name>Francois Deppierraz</name>
    <email>francois@ctrlaltdel.ch</email>
  </author>
  <url>http://github.com/ctrlaltdel/TahoeLAFS-android/commit/cd0a5667cbc28a2a84627ea92cc3cadd69c01c27</url>
  <id>cd0a5667cbc28a2a84627ea92cc3cadd69c01c27</id>
  <committed-date>2009-09-06T05:48:49-07:00</committed-date>
  <authored-date>2009-09-06T05:48:49-07:00</authored-date>
  <message>Convert RESTClient static methods into instance methods</message>
  <tree>ecc0b761c98abd938f7957c62a4811737197167e</tree>
  <committer>
    <name>Francois Deppierraz</name>
    <email>francois@ctrlaltdel.ch</email>
  </committer>
</commit>
