public Dir createDir(URL url) throws Exception { try { URLConnection urlConnection = url.openConnection(); if (urlConnection instanceof JarURLConnection) { urlConnection.setUseCaches(false); return new ZipDir(((JarURLConnection) urlConnection).getJarFile()); } } catch (Throwable e) { /*fallback*/ } java.io.File file = getFile(url); if (file != null) { return new ZipDir(new JarFile(file)); } return null; } },
public Dir createDir(URL url) throws Exception { try { URLConnection urlConnection = url.openConnection(); if (urlConnection instanceof JarURLConnection) { return new ZipDir(((JarURLConnection) urlConnection).getJarFile()); } } catch (Throwable e) { /*fallback*/ } java.io.File file = getFile(url); if (file != null) { return new ZipDir(new JarFile(file)); } return null; } },
public Dir createDir(final URL url) throws Exception { return new ZipDir(new JarFile(getFile(url))); } },
public Dir createDir(final URL url) { try { URL adaptedUrl = adaptURL(url); return new ZipDir(new JarFile(adaptedUrl.getFile())); } catch (Exception e) { try { return new ZipDir(new JarFile(url.getFile())); } catch (IOException e1) { if (Reflections.log != null) { Reflections.log.warn("Could not get URL", e); Reflections.log.warn("Could not get URL", e1); } } } return null; }
public Dir createDir(final URL url) throws Exception { return new ZipDir(new JarFile(getFile(url))); } },
public Dir createDir(final URL url) { try { URL adaptedUrl = adaptURL(url); return new ZipDir(new JarFile(adaptedUrl.getFile())); } catch (Exception e) { try { return new ZipDir(new JarFile(url.getFile())); } catch (IOException e1) { if (Reflections.log != null) { Reflections.log.warn("Could not get URL", e); Reflections.log.warn("Could not get URL", e1); } } } return null; }
public Vfs.Dir createDir(URL url) throws Exception { Object content = url.openConnection().getContent(); Class<?> virtualFile = ClasspathHelper.contextClassLoader().loadClass("org.jboss.vfs.VirtualFile"); java.io.File physicalFile = (java.io.File) virtualFile.getMethod("getPhysicalFile").invoke(content); String name = (String) virtualFile.getMethod("getName").invoke(content); java.io.File file = new java.io.File(physicalFile.getParentFile(), name); if (!file.exists() || !file.canRead()) file = physicalFile; return file.isDirectory() ? new SystemDir(file) : new ZipDir(new JarFile(file)); } },
public Vfs.Dir createDir(URL url) throws Exception { Object content = url.openConnection().getContent(); Class<?> virtualFile = ClasspathHelper.contextClassLoader().loadClass("org.jboss.vfs.VirtualFile"); java.io.File physicalFile = (java.io.File) virtualFile.getMethod("getPhysicalFile").invoke(content); String name = (String) virtualFile.getMethod("getName").invoke(content); java.io.File file = new java.io.File(physicalFile.getParentFile(), name); if (!file.exists() || !file.canRead()) file = physicalFile; return file.isDirectory() ? new SystemDir(file) : new ZipDir(new JarFile(file)); } },
public Dir createDir(URL url) throws Exception { try { URLConnection urlConnection = url.openConnection(); if (urlConnection instanceof JarURLConnection) { return new ZipDir(((JarURLConnection) urlConnection).getJarFile()); } } catch (Throwable e) { /*fallback*/ } java.io.File file = getFile(url); if (file != null) { return new ZipDir(new JarFile(file)); } return null; } },
public Vfs.Dir createDir(URL url) throws Exception { Object content = url.openConnection().getContent(); Class<?> virtualFile = ClasspathHelper.contextClassLoader().loadClass("org.jboss.vfs.VirtualFile"); java.io.File physicalFile = (java.io.File) virtualFile.getMethod("getPhysicalFile").invoke(content); String name = (String) virtualFile.getMethod("getName").invoke(content); java.io.File file = new java.io.File(physicalFile.getParentFile(), name); if (!file.exists() || !file.canRead()) file = physicalFile; return file.isDirectory() ? new SystemDir(file) : new ZipDir(new JarFile(file)); } },
public Dir createDir(URL url) throws Exception { try { URLConnection urlConnection = url.openConnection(); if (urlConnection instanceof JarURLConnection) { return new ZipDir(((JarURLConnection) urlConnection).getJarFile()); } } catch (Throwable e) { /*fallback*/ } java.io.File file = getFile(url); if (file != null) { return new ZipDir(new JarFile(file)); } return null; } },
@Override public Vfs.Dir createDir(final URL url) throws IOException, URISyntaxException { final File file = new File(url.toURI()); if (file.isDirectory()) { return new SystemDir(file); } else { return new ZipDir(new JarFile(file)); } } }
public Dir createDir(final URL url) throws Exception { return new ZipDir(new JarFile(getFile(url))); } },
private Vfs.Dir createDir(java.io.File file) { try { return file.exists() && file.canRead() ? file.isDirectory() ? new SystemDir(file) : new ZipDir(new JarFile(file)) : null; } catch (IOException e) { e.printStackTrace(); } return null; } }
public Vfs.Dir createDir(URL url) throws Exception { Object content = url.openConnection().getContent(); Class<?> virtualFile = ClasspathHelper.contextClassLoader().loadClass("org.jboss.vfs.VirtualFile"); java.io.File physicalFile = (java.io.File) virtualFile.getMethod("getPhysicalFile").invoke(content); String name = (String) virtualFile.getMethod("getName").invoke(content); java.io.File file = new java.io.File(physicalFile.getParentFile(), name); if (!file.exists() || !file.canRead()) file = physicalFile; return file.isDirectory() ? new SystemDir(file) : new ZipDir(new JarFile(file)); } },
public Dir createDir(final URL url) throws Exception { return new ZipDir(new JarFile(getFile(url))); } },
public Dir createDir(final URL url) throws Exception { return new ZipDir(new JarFile(getFile(url))); } },
public Vfs.Dir createDir(URL url) throws Exception { Object content = url.openConnection().getContent(); Class<?> virtualFile = ClasspathHelper.contextClassLoader().loadClass("org.jboss.vfs.VirtualFile"); java.io.File physicalFile = (java.io.File) virtualFile.getMethod("getPhysicalFile").invoke(content); String name = (String) virtualFile.getMethod("getName").invoke(content); java.io.File file = new java.io.File(physicalFile.getParentFile() , name); if (! file.exists() || ! file.canRead()) file = physicalFile; return file.isDirectory() ? new SystemDir(file) : new ZipDir(new JarFile(file)); } },
@Override public Vfs.Dir createDir(URL url) throws Exception { File file = Vfs.getFile(url); return file.isDirectory() ? new SystemDir(file) : new ZipDir(new JarFile(Vfs.getFile(url))); } });
@Override public Vfs.Dir createDir(URL url) throws Exception { File file = Vfs.getFile(url); return file.isDirectory() ? new SystemDir(file) : new ZipDir(new JarFile(Vfs.getFile(url))); } });