From dc3b4431dc66eff79ec34a3207972a06f9788ad0 Mon Sep 17 00:00:00 2001 From: wisberg Date: Thu, 12 May 2005 11:49:53 +0000 Subject: [PATCH] FileToURL via URI --- util/src/org/aspectj/util/FileUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/src/org/aspectj/util/FileUtil.java b/util/src/org/aspectj/util/FileUtil.java index 8745750c5..2d2a90e0e 100644 --- a/util/src/org/aspectj/util/FileUtil.java +++ b/util/src/org/aspectj/util/FileUtil.java @@ -879,7 +879,11 @@ public class FileUtil { LangUtil.throwIaxIfNull(file, "file"); URL result = null; try { - String url = "file:" + file.getAbsolutePath().replace('\\', '/'); + result = file.toURI().toURL(); + if (null != result) { + return result; + } + String url = "file:" + file.getAbsolutePath().replace('\\', '/'); result = new URL(url + (file.isDirectory() ? "/" : "")); } catch (MalformedURLException e) { String m = "Util.makeURL(\"" + file.getPath() + "\" MUE " + e.getMessage(); @@ -1349,6 +1353,7 @@ public class FileUtil { try { final int MAX = 4096; byte[] buf = new byte[MAX]; + // TODO this blocks, hanging the harness int count = in.read(buf, 0, MAX); ByteArrayOutputStream mySnoop; while ((halt && finishStream && (0 < count)) -- 2.39.5