Example usage for org.eclipse.jgit.archive ArchiveFormats registerAll

List of usage examples for org.eclipse.jgit.archive ArchiveFormats registerAll

Introduction

In this page you can find the example usage for org.eclipse.jgit.archive ArchiveFormats registerAll.

Prototype

public static void registerAll() 

Source Link

Document

Register all included archive formats so they can be used as arguments to the ArchiveCommand.setFormat() method.

Usage

From source file:com.buildautomation.jgit.api.CreateArchive.java

License:Apache License

public static void createArchive() throws IOException, GitAPIException {
    try (Repository repository = CookbookHelper.openJGitCookbookRepository()) {
        // make the included archive formats known
        ArchiveFormats.registerAll();
        try {/*from   w w w . j  a  v a  2  s  .  c  o  m*/
            write(repository, ".zip", "zip");
            write(repository, ".tar.gz", "tgz");
            write(repository, ".tar.bz2", "tbz2");
            write(repository, ".tar.xz", "txz");
        } finally {
            ArchiveFormats.unregisterAll();
        }
    }
}

From source file:edu.nju.cs.inform.jgit.porcelain.CreateArchive.java

License:Apache License

public static void main(String[] args) throws IOException, GitAPIException {
    try (Repository repository = CookbookHelper.openJGitCookbookRepository()) {
        // make the included archive formats known
        ArchiveFormats.registerAll();
        try {/*from   w w w .j a  v  a  2 s .  c  o  m*/
            write(repository, ".zip", "zip");
            write(repository, ".tar.gz", "tgz");
            write(repository, ".tar.bz2", "tbz2");
            write(repository, ".tar.xz", "txz");
        } finally {
            ArchiveFormats.unregisterAll();
        }
    }
}