Skip to content

Commit

Permalink
Check url
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Sep 12, 2014
1 parent 8b9c4a1 commit f9bcaca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/xiaoleilu/hutool/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,10 @@ public static String readString(String path, String charset) throws IOException
* @throws IOException
*/
public static String readString(URL url, String charset) throws IOException {
if(url == null) {
throw new RuntimeException("Empty url provided!");
}

InputStream in = null;
try {
in = url.openStream();
Expand Down

0 comments on commit f9bcaca

Please sign in to comment.