Package java.util.jar

Examples of java.util.jar.JarFile.entries()


        try {
            final JarURLConnection connection = (JarURLConnection) new URI("jar:" + uri + "!/").toURL().openConnection();
            final JarFile jarFile = connection.getJarFile();

            final Enumeration<JarEntry> entries = jarFile.entries();

            while (entries.hasMoreElements()) {
                final JarEntry entry = entries.nextElement();

                // We only search for class file entries
View Full Code Here


        try {
            final JarURLConnection connection = (JarURLConnection) new URI("jar:" + new File(uri).toURI() + "!/").toURL().openConnection();
            final JarFile jarFile = connection.getJarFile();

            final Enumeration<JarEntry> entries = jarFile.entries();

            while (entries.hasMoreElements()) {
                final JarEntry entry = entries.nextElement();

                // We only search for class file entries
View Full Code Here

  }

  public void weaveJarFile(String sourceJarFileName, String destJarFileName)
      throws IOException {
    JarFile jarFile = new JarFile(sourceJarFileName);
    ArrayList<JarEntry> entries = Collections.list(jarFile.entries());

    OutputStream os = new FileOutputStream(destJarFileName);
    JarOutputStream out = new JarOutputStream(os);

    int n = 0;
View Full Code Here

  }

  public void weaveJarFile(String sourceJarFileName, String destJarFileName)
      throws IOException {
    JarFile jarFile = new JarFile(sourceJarFileName);
    ArrayList<JarEntry> entries = Collections.list(jarFile.entries());

    OutputStream os = new FileOutputStream(destJarFileName);
    JarOutputStream out = new JarOutputStream(os);

    int n = 0;
View Full Code Here

  }

  public void weaveJarFile(String sourceJarFileName, String destJarFileName)
      throws IOException {
    JarFile jarFile = new JarFile(sourceJarFileName);
    ArrayList<JarEntry> entries = Collections.list(jarFile.entries());

    OutputStream os = new FileOutputStream(destJarFileName);
    JarOutputStream out = new JarOutputStream(os);

    int n = 0;
View Full Code Here

      // method which returns URLs for as long as it is available
      List<URL> paths = new ArrayList<URL>();
      paths.add(new File(dst.toString()).getCanonicalFile().toURL());

      JarFile jarFile = new JarFile(dst.toString());
      Enumeration<JarEntry> entries = jarFile.entries();
      while (entries.hasMoreElements()) {
        JarEntry entry = entries.nextElement();
        if (entry.getName().matches("/lib/[^/]+\\.jar")) {
          File file = new File(System.getProperty("java.io.tmpdir") +
              java.io.File.separator +"." + pathPrefix +
View Full Code Here

            {
                JarFile jar = null;
                try
                {
                    jar = new JarFile( artifact );
                    Enumeration<JarEntry> entries = jar.entries();
                    while ( entries.hasMoreElements() )
                    {
                        JarEntry entry = entries.nextElement();
                        if ( matcher.shouldInclude( entry.getName() ) )
                        {
View Full Code Here

        try {
            if (jarName == null) {
                jarName = Boot.getMyJarPath();
            }
            JarFile jarFile = new JarFile(jarName);
            Enumeration _enum = jarFile.entries();
            Manifest manifest = jarFile.getManifest();
            String expandPaths[] = null;
            // TODO: Allow a destination directory (relative or absolute) to
            // be specified like this:
            // One-Jar-Expand: build=../expanded
View Full Code Here

    addURL(dst.getCanonicalFile().toURI().toURL());

    JarFile jarFile = new JarFile(dst.toString());
    try {
      Enumeration<JarEntry> entries = jarFile.entries();
      while (entries.hasMoreElements()) {
        JarEntry entry = entries.nextElement();
        if (entry.getName().matches("[/]?lib/[^/]+\\.jar")) {
          File file = new File(parentDir, "." + pathPrefix + "." + path.getName()
            + "." + System.currentTimeMillis() + "." + entry.getName().substring(5));
View Full Code Here

        // Extract the JAR into the new directory
        JarFile jarFile = null;
        InputStream input = null;
        try {
            jarFile = new JarFile(file);
            Enumeration jarEntries = jarFile.entries();
            while (jarEntries.hasMoreElements()) {
                JarEntry jarEntry = (JarEntry) jarEntries.nextElement();
                String name = jarEntry.getName();
                int last = name.lastIndexOf('/');
                if (last >= 0) {
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.