Package java.util.jar

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


                            int count;
                            while ((count = in.read(buffer)) > 0) {
                                out.write(buffer, 0, count);
                            }
                        } finally {
                            out.closeEntry();
                        }
                    } finally {
                        close(in);
                    }
                }
View Full Code Here


                        InputStream in = input.getInputStream(entry);
                        while ((count = in.read(buf)) > -1) {
                            out.write(buf, 0, count);
                        }
                        in.close();
                        out.closeEntry();
                    }
                }
                out.flush();
                out.close();
                input.close();
View Full Code Here

                            int count;
                            while ((count = in.read(buffer)) > 0) {
                                out.write(buffer, 0, count);
                            }
                        } finally {
                            out.closeEntry();
                        }
                    } finally {
                        IOUtils.close(in);
                    }
                }
View Full Code Here

        JarOutputStream jout = new JarOutputStream(result);

        JarEntry metaModel = new JarEntry("factmodel.xml");
        jout.putNextEntry(metaModel);
        jout.write(toXML(facts));
        jout.closeEntry();

        String packagePath = packageName.replace('.', '/');

        for (int i = 0; i < facts.length; i++) {
            ClassBuilder cb = new ClassBuilderFactory().getBeanClassBuilder();
View Full Code Here

                classDef.addField(new FieldDefinition(fd.name, fd.type));
            }
            JarEntry je = new JarEntry(packagePath + "/" + facts[i].name + ".class");
            jout.putNextEntry(je);
            jout.write(cb.buildClass(classDef,null));
            jout.closeEntry();
        }
        jout.flush();
        jout.close();

        return result.toByteArray();
View Full Code Here

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

                i.close();
                jos.closeEntry();

            } else {

                jis = new JarInputStream(in);
View Full Code Here

                            }
                        }
                    }

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

                // If the file is not found, add it
                if (!found) {
                    jos.putNextEntry(new JarEntry(fullPath));
View Full Code Here

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

                    i.close();
                    jos.closeEntry();
                }
            }

            item.updateBinaryContentAttachment(new ByteArrayInputStream(bais
                    .toByteArray()));
View Full Code Here

        FileOutputStream out = new FileOutputStream( new File( "/Users/michaelneale/edson.jar" ) );
        JarOutputStream jout = new JarOutputStream( out );
        JarEntry je = new JarEntry( "br/com/auster/TestClass1.class" );
        jout.putNextEntry( je );
        jout.write( data );
        jout.closeEntry();
        jout.close();
    }

    @Test
    public void testEquals() {
View Full Code Here

         entry.setTime(src.lastModified());
         entry.setMethod(JarOutputStream.STORED);
         entry.setSize(0L);
         entry.setCrc(0L);
         jout.putNextEntry(entry);
         jout.closeEntry();
        
         // process the sub-directories
         File[] files = src.listFiles(info.filter);
         for (int i = 0; i < files.length; i++)
         {
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.