Package java.util.jar

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


         File file = new File(dest, fileName);
         if (entry.isDirectory())
         {
            // make sure the directory exists
            file.mkdirs();
            jin.closeEntry();
         }
         else
         {
            // make sure the directory exists
            File parent = file.getParentFile();
View Full Code Here


            {
               out.write(buffer, 0, len);
            }
            out.flush();
            out.close();
            jin.closeEntry();
            file.setLastModified(entry.getTime());
         }
         entry = jin.getNextEntry();
      }
      /* Explicity write out the META-INF/MANIFEST.MF so that any headers such
View Full Code Here

        } else if (acceptResource(filename, false)) {
          byte[] bytes = FileUtil.readAsByteArray(inStream);
          writeResource(filename, bytes, jarFile);
        }

        inStream.closeEntry();
      }
    } finally {
      if (inStream != null) {
        inStream.close();
      }
View Full Code Here

                jos.putNextEntry(entryOut);
                if (!entryIn.isDirectory()) {
                    IOUtils.copy(jis, jos);
                }
                jos.closeEntry();
                jis.closeEntry();
                entryIn = jis.getNextJarEntry();
            }

            // close the JAR file now to force writing
            jos.close();
View Full Code Here

                jos.putNextEntry(entryOut);
                if (!entryIn.isDirectory()) {
                    spool(jis, jos);
                }
                jos.closeEntry();
                jis.closeEntry();
                entryIn = jis.getNextJarEntry();
            }

            // close the JAR file now to force writing
            jos.close();
View Full Code Here

                int read = jis.read(input);

                assertEquals("Not all bytes were read: " + entry.getName(), size, read);

                // Contents will only be completely written after closing the JAR entry itself...
                jis.closeEntry();

                verifyContents(f, input);
            }

            assertEquals("Manifest not as expected", man, jis.getManifest());
View Full Code Here

JarEntry inEnt;
while ((inEnt = in.getNextJarEntry()) != null) {
  JarEntry outEnt = new JarEntry(inEnt); // copy size, modification time etc.
  byte[] data = new byte[(int)inEnt.getSize()];
  in.read(data); // read data for this old entry
  in.closeEntry();
  out.putNextEntry(outEnt);
  out.write(data); // copy it to the new entry
  out.closeEntry();
}
in.close();
View Full Code Here

// copy the files from the old JAR to the new, but don't close the new JAR yet
while ((inEnt = in.getNextJarEntry()) != null) {
  JarEntry outEnt = new JarEntry(inEnt); // copy size, modification time etc.
  byte[] data = new byte[(int)inEnt.getSize()];
  in.read(data); // read data for this old entry
  in.closeEntry();
  out.putNextEntry(outEnt);
  out.write(data); // copy it to the new entry
  out.closeEntry();
}
// and *now* we close the new JAR file.
View Full Code Here

          loadClass(jarName.substring(0, jarName.length() - 6).replace('/', '.'));
        }
        if (jarName.endsWith("plugin.xml")) {
          pluginXMLs.add(new URL("jar:"+jarUrl.getProtocol()+":"+jarUrl.getPath()+"!/"+jarName));
        }
        jis.closeEntry();
      }
      for (URL url : pluginXMLs) {
        /* if (logger.isDebugEnabled()) {
          logger.debug("  Loading "+url+"\n");
        }*/
 
View Full Code Here

                    } finally {
                        SVNFileUtil.closeFile(fos);
                        SVNFileUtil.closeFile(fis);
                    }
                }
                jis.closeEntry();
            }
        } catch (IOException e) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Can not extract repository files from ''{0}'' to ''{1}''",
                    new Object[] {srcFile, dst});
            err.setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage()));
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.