Package org.apache.commons.compress.archivers.tar

Examples of org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish()


      } else {
        addFileToTar(tOut, file, file.getName());
      }
    } finally {
      if (tOut != null) {
        tOut.finish();
        tOut.close();
      }
      if (gzOut != null) {
        gzOut.close();
      }
View Full Code Here


      tarArchiveOutputStream = new TarArchiveOutputStream(gzipOutputStream);

      addFilesInDirectory(tarArchiveOutputStream, sourceDirectory);
    } finally {
      if (tarArchiveOutputStream != null) {
        tarArchiveOutputStream.finish();
      }
      if (tarArchiveOutputStream != null) {
        tarArchiveOutputStream.close();
      }
      if (gzipOutputStream != null) {
View Full Code Here

//                // TODO Auto-generated catch block
//                e.printStackTrace();
            }
        }
        tos.flush();
        tos.finish();
        tos.close();
    }

    public static void read() throws Throwable {
        FileInputStream fis = new FileInputStream("C:\\X2.tgz");
View Full Code Here

            }
            if (schemaFile == null) {
                throw new LDPathException("Schema template ZIP should include: " + SOLR_TEMPLATE_SCHEMA);
            }
            tarOutputStream.finish();
            tarOutputStream.close();
        } catch (IOException e) {
            logger.error("", e);
            throw new LDPathException(e);
        }
View Full Code Here

            }
            if (schemaFile == null) {
                throw new LDPathException("Schema template ZIP should include: " + SOLR_TEMPLATE_SCHEMA);
            }
            tarOutputStream.finish();
            tarOutputStream.close();
        } catch (IOException e) {
            logger.error("", e);
            throw new LDPathException(e);
        }
View Full Code Here

        tos.putArchiveEntry(txtEntry);
        tos.write(txtBytes);
        tos.closeArchiveEntry();

        // cleanup
        tos.finish();
        tos.close();
        cos.close();
        os.flush();
      }
    } catch (Exception e) {
View Full Code Here

          tos.putArchiveEntry(entry);
          loader.copyTo(tos);
          tos.closeArchiveEntry();
        }
      }
      tos.finish();
      tos.close();
      cos.close();
      success = true;
    } catch (IOException e) {
      error(e, repository, "{0} failed to {1} stream files from commit {2}", algorithm, commit.getName());
View Full Code Here

        tos.putArchiveEntry(txtEntry);
        tos.write(txtBytes);
        tos.closeArchiveEntry();

        // cleanup
        tos.finish();
        tos.close();
        cos.close();
        os.flush();
      }
    } catch (Exception e) {
View Full Code Here

          tos.putArchiveEntry(entry);
          loader.copyTo(tos);
          tos.closeArchiveEntry();
        }
      }
      tos.finish();
      tos.close();
      cos.close();
      success = true;
    } catch (IOException e) {
      error(e, repository, "{0} failed to {1} stream files from commit {2}", algorithm, commit.getName());
View Full Code Here

      IOUtils.copy(new ByteArrayInputStream(newContent.getBytes()), newArchiveOut);
      newArchiveOut.closeArchiveEntry();

      return newArchive;
    } finally {
      newArchiveOut.finish();
      newArchiveOut.flush();
      StreamUtils.close(archiveIn);
      StreamUtils.close(newArchiveOut);
    }
  }
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.