Package java.util.jar

Examples of java.util.jar.JarInputStream.closeEntry()


                    String name = jarEntry.getName().substring( 0, jarEntry.getName().indexOf( "." ) );

                    classes.add( name.replaceAll( "/", "\\." ) );
                }

                jarStream.closeEntry();
                jarEntry = jarStream.getNextJarEntry();
            }
        }
        finally
        {
View Full Code Here


                final int len = (int) entry.getSize();
                if (len >= 0) {
                    // Size known in advance, we can allocate contents
                    // buffer directly.
                    if (len > MAX_FILE_SIZE) {
                        jar.closeEntry();
                        continue;
                    }
                    final byte[] cont = new byte[len];
                    int read = 0;
                    while (read < len) {
View Full Code Here

                        if (read <= 0) {
                            break;
                        }
                        size += read;
                        if (size > MAX_FILE_SIZE) {
                            jar.closeEntry();
                            continue process_entries;
                        }
                    }
                    contents.put(name, Arrays.copyOf(buf, size));
                }
View Full Code Here

                        }
                    }
                    contents.put(name, Arrays.copyOf(buf, size));
                }
                entries.put(name, entry);
                jar.closeEntry();
            }
            jar.close();
        }

        @Override
View Full Code Here

        if (!entry.isDirectory() && acceptResource(filename)) {
          byte[] bytes = FileUtil.readAsByteArray(inStream);
          writeResource(filename,bytes,jarFile);
        }
 
        inStream.closeEntry();
      }
    } finally {
      if (inStream != null) inStream.close();
    }
  }
View Full Code Here

/*     */       }
/* 281 */       File file = new File(dest, fileName);
/* 282 */       if (entry.isDirectory())
/*     */       {
/* 285 */         file.mkdirs();
/* 286 */         jin.closeEntry();
/*     */       }
/*     */       else
/*     */       {
/* 291 */         File parent = file.getParentFile();
/* 292 */         if ((parent != null) && (!parent.exists()))
View Full Code Here

/*     */         {
/* 302 */           out.write(buffer, 0, len);
/*     */         }
/* 304 */         out.flush();
/* 305 */         out.close();
/* 306 */         jin.closeEntry();
/* 307 */         file.setLastModified(entry.getTime());
/*     */       }
/* 309 */       entry = jin.getNextEntry();
/*     */     }
/*     */
View Full Code Here

                jos.write(copyBuf, 0, len);
              }
            }
          }

          jis.closeEntry();
          jos.closeEntry();
        }

        // If the file is not found, add it
        if (!found) {
View Full Code Here

            this.rarFile = rarFile;
        }
       
        public void installInEARContext(EARContext earContext, URI moduleBase) throws DeploymentException, IOException {
            JarInputStream jarIS = new JarInputStream(new FileInputStream(rarFile.getName()));
            for (JarEntry entry; (entry = jarIS.getNextJarEntry()) != null; jarIS.closeEntry()) {
                URI target = moduleBase.resolve(entry.getName());
                if (entry.getName().endsWith(".jar")) {
                    earContext.addStreamInclude(target, jarIS);
                } else {
                    earContext.addFile(target, jarIS);
View Full Code Here

            this.webAppFile = webAppFile;
        }

        public void installInEARContext(EARContext earContext, URI moduleBase) throws DeploymentException, IOException {
            JarInputStream jarIS = new JarInputStream(new FileInputStream(webAppFile.getName()));
            for (JarEntry entry; (entry = jarIS.getNextJarEntry()) != null; jarIS.closeEntry()) {
                URI target = moduleBase.resolve(entry.getName());
                // TODO gets rid of these tests when Jetty will use the
                // serialized Geronimo DD.
                if ( entry.getName().equals("WEB-INF/web.xml") &&
                    null != webModule.getAltSpecDD() ) {
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.