eu.lindenbaum.maven.archiver
Class TarGzArchiver

java.lang.Object
  extended by eu.lindenbaum.maven.archiver.TarGzArchiver

public final class TarGzArchiver
extends Object

An archiver that can create gzipped tar archives using the erlang erl_tar module.

Author:
Tobias Schlager

Constructor Summary
TarGzArchiver(String peer, String cookie, File archive)
           
 
Method Summary
 void addFile(File file)
          Add a file/directory to the archive.
 void addFile(File file, String archiveName)
          Add a file/directory to the archive.
 void createArchive()
          Creates and writes the archive to archive.
 File getArchive()
          Returns this archivers archive file no matter already created or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarGzArchiver

public TarGzArchiver(String peer,
                     String cookie,
                     File archive)
Method Detail

getArchive

public File getArchive()
Returns this archivers archive file no matter already created or not.

Returns:
this archivers archive file

addFile

public void addFile(File file)
             throws IOException
Add a file/directory to the archive.

Parameters:
file - to add to the archive
Throws:
IOException - if the file does not exist

addFile

public void addFile(File file,
                    String archiveName)
             throws IOException
Add a file/directory to the archive.

Parameters:
file - to add to the archive
archiveName - name of the file in the archive
Throws:
IOException - if the file does not exist

createArchive

public void createArchive()
                   throws IOException
Creates and writes the archive to archive.

Throws:
IOException - if there are no files to archive or erl_tar ends with erros


Copyright © 2011 Lindenbaum GmbH. All Rights Reserved.