Package org.apache.commons.compress.archivers

Examples of org.apache.commons.compress.archivers.ArchiveOutputStream.closeArchiveEntry()


        aos2.write(byteTest);
        aos2.closeArchiveEntry();
        aos2.close();
       
        aos3.write(byteTest, 0, byteTest.length);
        aos3.closeArchiveEntry();
        aos3.close();
        assertEquals("out1!=out2",out1.toString(),out2.toString());
        assertEquals("out1!=out3",out1.toString(),out3.toString());
    }
   
View Full Code Here


            final ArchiveOutputStream os = new ArchiveStreamFactory()
                .createArchiveOutputStream("jar", out);

            os.putArchiveEntry(new ZipArchiveEntry("testdata/test1.xml"));
            IOUtils.copy(new FileInputStream(file1), os);
            os.closeArchiveEntry();

            os.putArchiveEntry(new ZipArchiveEntry("testdata/test2.xml"));
            IOUtils.copy(new FileInputStream(file2), os);
            os.closeArchiveEntry();
View Full Code Here

            IOUtils.copy(new FileInputStream(file1), os);
            os.closeArchiveEntry();

            os.putArchiveEntry(new ZipArchiveEntry("testdata/test2.xml"));
            IOUtils.copy(new FileInputStream(file2), os);
            os.closeArchiveEntry();

            os.close();
        } finally {
            out.close();
        }
View Full Code Here

        aos2.write(byteTest);
        aos2.closeArchiveEntry();
        aos2.close();

        aos3.write(byteTest, 0, byteTest.length);
        aos3.closeArchiveEntry();
        aos3.close();
        assertEquals("out1!=out2",out1.toString(),out2.toString());
        assertEquals("out1!=out3",out1.toString(),out3.toString());
    }
View Full Code Here

              entry.setMode(0100000);
              os.putArchiveEntry(entry);
              IOUtils.copy(new FileInputStream(file), os);
        }
      }
          os.closeArchiveEntry();
          os.close();
      manager.completeWorkItem(workItem.getId(), null);
    } catch (Throwable t) {
      t.printStackTrace();
      manager.abortWorkItem(workItem.getId());
View Full Code Here

        while ((read = in.read(buf)) > 0) {
            tarOut.write(buf, 0, read);
        }

        in.close();
        tarOut.closeArchiveEntry();
        tarOut.close();

        assertEquals(f.length(), tarOut.getBytesWritten());
    }
View Full Code Here

                        IOUtils.copy(fis, aos);
                    } finally {
                        fis.close();
                    }
                }
                aos.closeArchiveEntry();
                entriesToClose--;
            }
        } catch(Exception e){
            wasError = true;
View Full Code Here

        } catch(Exception e){
            wasError = true;

            while(entriesToClose-- >0){
                try {
                    aos.closeArchiveEntry();
                } catch (IOException ignored) {}
            }

            if(e instanceof IOException){
                throw (IOException) e;
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.