Examples of IVirtualDirectory


Examples of net.sourceforge.javautil.common.io.IVirtualDirectory

   * @param repositoryName The repository from which to get the jar
   * @param name The name of the jar
   * @return The directory/jar
   */
  public static IVirtualDirectory getInMemoryJar (String repositoryName, String name) {
    IVirtualDirectory jar = getInMemoryRepository(repositoryName, false).getDirectory(name);
    if (jar == null) throw new IllegalArgumentException("Could not find repository jar: " + repositoryName + ":" + name);
    return jar;
  }
View Full Code Here

Examples of net.sourceforge.javautil.common.io.IVirtualDirectory

   * @param name The name of the jar
   * @param input The input from which to read the jar
   * @return A class source pointing to the in memory jar
   */
  public static VirtualDirectoryClassSource createInMemoryJar (String repositoryName, String name, ZipInputStream input) {
    IVirtualDirectory directory = getInMemoryRepository(repositoryName, true).getDirectory(name, true);
    try {
      ZipEntry entry = null;
      do {
        entry = input.getNextEntry();
        if (entry != null) {
          if (entry.getName().endsWith("/")) {
            directory.createDirectory(new SimplePath(entry.getName()));
          } else
            directory.createFile(new SimplePath(entry.getName()), IOUtil.read(input, null, false));
        }
      } while (entry != null);
    } catch (IOException e) {
      throw ThrowableManagerRegistry.caught(e);
    } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.