private void checkToURL(String fn, String match) { @SuppressWarnings("deprecation") String r = FileUtils.toURL(fn); if (!r.matches("^.*/[^/]*" + match + "[^/]*$")) fail("Converted \"" + fn + "\" to <" + r + "> which did not match /" + match + "/"); if (!r.startsWith("file:///")) fail("Converted \"" + fn + "\" to <" + r + "> which does not start file:///"); if (r.startsWith("file:////")) fail("Converted \"" + fn + "\" to <" + r + "> which has too many initial /"); } }
private void checkToURL(String fn, String match) { @SuppressWarnings("deprecation") String r = FileUtils.toURL(fn); if (!r.matches("^.*/[^/]*" + match + "[^/]*$")) fail("Converted \"" + fn + "\" to <" + r + "> which did not match /" + match + "/"); if (!r.startsWith("file:///")) fail("Converted \"" + fn + "\" to <" + r + "> which does not start file:///"); if (r.startsWith("file:////")) fail("Converted \"" + fn + "\" to <" + r + "> which has too many initial /"); } }