Fix the rest of the tests

This commit is contained in:
Winston Li
2015-03-05 15:39:05 +00:00
parent 5df8b2b65f
commit e6bdbe8f17
2 changed files with 44 additions and 37 deletions

View File

@@ -2,10 +2,7 @@ package uk.ac.ic.wlgitbridge.util;
import uk.ac.ic.wlgitbridge.application.SSLConfig;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
@@ -152,4 +149,17 @@ public class Util {
}
}
public static String fromStream(InputStream in) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuilder out = new StringBuilder();
String newLine = System.getProperty("line.separator");
String line;
while ((line = reader.readLine()) != null) {
out.append(line);
out.append(newLine);
}
return out.toString();
}
}