public static InputStream getInputStream(URL url) throws IOException { if ("file".equals(url.getProtocol())) { String path = url.getFile().replace('/', File.separatorChar); path = ParseUtil.decode(path); return new FileInputStream(path); } else { return url.openStream(); } }
public static InputStream getInputStream(URL url) throws IOException { if ("file".equals(url.getProtocol())) { String path = url.getFile().replace('/', File.separatorChar); path = ParseUtil.decode(path); return new FileInputStream(path); } else { return url.openStream(); } }
/** * Modified from java.net.JarURLConnection * * @param url URL to parse * @throws MalformedURLException */ private void parseSpecs(URL url) throws MalformedURLException { String spec = url.getFile(); if (spec.startsWith("jar:")) { spec = spec.substring(4, spec.length()); } int separator = spec.indexOf("!/"); jarFileURL = new URL(spec.substring(0, separator++)); entryName = null; /* if ! is the last letter of the innerURL, entryName is null */ if (++separator != spec.length()) { entryName = spec.substring(separator, spec.length()); entryName = ParseUtil.decode(entryName); int subEntrySeparator = entryName.indexOf("!/"); if (subEntrySeparator != -1) { subEntryName = entryName.substring(subEntrySeparator + 2, entryName.length()); entryName = entryName.substring(0, subEntrySeparator); } } }
/** * Modified from java.net.JarURLConnection * * @param url URL to parse * @throws MalformedURLException */ private void parseSpecs(URL url) throws MalformedURLException { String spec = url.getFile(); if (spec.startsWith("jar:")) { spec = spec.substring(4, spec.length()); } int separator = spec.indexOf("!/"); jarFileURL = new URL(spec.substring(0, separator++)); entryName = null; /* if ! is the last letter of the innerURL, entryName is null */ if (++separator != spec.length()) { entryName = spec.substring(separator, spec.length()); entryName = ParseUtil.decode(entryName); int subEntrySeparator = entryName.indexOf("!/"); if (subEntrySeparator != -1) { subEntryName = entryName.substring(subEntrySeparator + 2, entryName.length()); entryName = entryName.substring(0, subEntrySeparator); } } }
path = policy_url.getFile(). replace('/', File.separatorChar); path = sun.net.www.ParseUtil.decode(path); policyFile = new File(path); found = policyFile.exists(); String path = policy_url.getFile(). replace('/', File.separatorChar); path = sun.net.www.ParseUtil.decode(path); File policyFile = new File(path); if (policyFile.exists()) {
path = policy_url.getFile(). replace('/', File.separatorChar); path = sun.net.www.ParseUtil.decode(path); policyFile = new File(path); found = policyFile.exists(); String path = policy_url.getFile(). replace('/', File.separatorChar); path = sun.net.www.ParseUtil.decode(path); File policyFile = new File(path); if (policyFile.exists()) {