Permalink
Browse files

No commit message

  • Loading branch information...
1 parent 7ef593b commit 69ee72e5cf78c16c34a6a9bb9c7bb19f3bd936e9 @jkreps jkreps committed Apr 22, 2009
Showing with 2 additions and 20 deletions.
  1. +2 −1 src/java/voldemort/store/readonly/StoreSwapper.java
  2. +0 −19 src/java/voldemort/utils/Utils.java
@@ -17,6 +17,7 @@
import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import voldemort.VoldemortException;
@@ -138,7 +139,7 @@ public static void main(String[] args) throws Exception {
String mgmtPath = args[2];
String filePath = args[3];
- String clusterStr = Utils.readString(new File(clusterXml));
+ String clusterStr = FileUtils.readFileToString(new File(clusterXml));
Cluster cluster = new ClusterMapper().readCluster(new StringReader(clusterStr));
ExecutorService executor = Executors.newFixedThreadPool(10);
HttpConnectionManager manager = new MultiThreadedHttpConnectionManager();
@@ -16,10 +16,7 @@
package voldemort.utils;
-import java.io.BufferedReader;
import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -411,20 +408,4 @@ private static RuntimeException getCause(InvocationTargetException e) {
throw new IllegalArgumentException(e.getCause());
}
- /**
- * Read the contents of the file as a string
- *
- * @param f The file to read
- * @return The string read
- * @throws IOException If the file doesn't exists or there are errors while
- * reading it
- */
- public static String readString(File f) throws IOException {
- BufferedReader reader = new BufferedReader(new FileReader(f));
- StringBuilder builder = new StringBuilder();
- for(int curr = reader.read(); curr >= 0; curr = reader.read())
- builder.append((char) curr);
- reader.close();
- return builder.toString();
- }
}

0 comments on commit 69ee72e

Please sign in to comment.