org.reflections.vfs.ZipDir.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.reflections.vfs.ZipDir.<init>()方法的一些代码示例,展示了ZipDir.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipDir.<init>()方法的具体详情如下:
包路径:org.reflections.vfs.ZipDir
类名称:ZipDir
方法名:<init>

ZipDir.<init>介绍

暂无

代码示例

代码示例来源:origin: ronmamo/reflections

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;
  }
},

代码示例来源:origin: org.reflections/reflections

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;
  }
},

代码示例来源:origin: ronmamo/reflections

public Dir createDir(final URL url) throws Exception {
    return new ZipDir(new JarFile(getFile(url)));
  }
},

代码示例来源:origin: ronmamo/reflections

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;
}

代码示例来源:origin: org.reflections/reflections

public Dir createDir(final URL url) throws Exception {
    return new ZipDir(new JarFile(getFile(url)));
  }
},

代码示例来源:origin: org.reflections/reflections

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;
}

代码示例来源:origin: ronmamo/reflections

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));
  }
},

代码示例来源:origin: org.reflections/reflections

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));
  }
},

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections

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;
  }
},

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections

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));
  }
},

代码示例来源:origin: org.rapidpm/rapidpm-dependencies-core-reflections

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;
 }
},

代码示例来源:origin: io.silverware/microservices

@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));
   }
 }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections

public Dir createDir(final URL url) throws Exception {
    return new ZipDir(new JarFile(getFile(url)));
  }
},

代码示例来源:origin: de.agilecoders.wicket.webjars/vfs-support

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;
  }
}

代码示例来源:origin: ai.h2o/reflections

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));
  }
},

代码示例来源:origin: ai.h2o/reflections

public Dir createDir(final URL url) throws Exception {
    return new ZipDir(new JarFile(getFile(url)));
  }
},

代码示例来源:origin: org.rapidpm/rapidpm-dependencies-core-reflections

public Dir createDir(final URL url) throws Exception {
  return new ZipDir(new JarFile(getFile(url)));
 }
},

代码示例来源:origin: org.rapidpm/rapidpm-dependencies-core-reflections

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));
 }
},

代码示例来源:origin: getgauge/gauge-java

@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)));
  }
});

代码示例来源:origin: com.thoughtworks.gauge/gauge-java

@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)));
  }
});

相关文章