forked from LogBlock/LogBlock
Added version check
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package de.diddiz.util;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
import java.text.ParseException;
|
||||
@@ -47,6 +49,16 @@ public class Utils
|
||||
throw new FileNotFoundException(file.getAbsolutePath() + file.getName());
|
||||
}
|
||||
|
||||
public static String readURL(URL url) throws IOException {
|
||||
final StringBuilder content = new StringBuilder();
|
||||
final BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null)
|
||||
content.append(inputLine);
|
||||
in.close();
|
||||
return content.toString();
|
||||
}
|
||||
|
||||
public static boolean isInt(String str) {
|
||||
try {
|
||||
Integer.parseInt(str);
|
||||
|
||||
Reference in New Issue
Block a user