Fixing some things that weren't thread safe.

More import / formatting cleanup.
This commit is contained in:
Steven Lawson
2013-03-20 20:19:07 -04:00
parent 71ec3d3a4d
commit 7b0977d58f
8 changed files with 23 additions and 15 deletions

View File

@ -18,7 +18,6 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.*;
@ -973,4 +972,16 @@ public class TFM_Util
}
}
}
public static String inputStreamToString(InputStream is, boolean preserveNewlines) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null)
{
sb.append(line).append(preserveNewlines ? System.lineSeparator() : "");
}
return sb.toString();
}
}