public static void main(String[] args) throws IOException, GitAPIException { try (Repository repository = CookbookHelper.openJGitCookbookRepository()) { // make the included archive formats known ArchiveFormats.registerAll(); try { write(repository, ".zip", "zip"); write(repository, ".tar.gz", "tgz"); write(repository, ".tar.bz2", "tbz2"); write(repository, ".tar.xz", "txz"); } finally { ArchiveFormats.unregisterAll(); } } }
/** * Cleans up after {@link #start(BundleContext)} by calling * {@link ArchiveFormats#unregisterAll}. * * @param context * unused */ public void stop(BundleContext context) { ArchiveFormats.unregisterAll(); } }
/** * Registers all included archive formats by calling * {@link ArchiveFormats#registerAll()}. This method is called by the OSGi * framework when the bundle is started. * * @param context * unused */ public void start(BundleContext context) { ArchiveFormats.registerAll(); }
/** * Register all included archive formats so they can be used * as arguments to the ArchiveCommand.setFormat() method. * * Not thread-safe. */ public static void registerAll() { register("tar", new TarFormat()); //$NON-NLS-1$ register("tgz", new TgzFormat()); //$NON-NLS-1$ register("tbz2", new Tbz2Format()); //$NON-NLS-1$ register("txz", new TxzFormat()); //$NON-NLS-1$ register("zip", new ZipFormat()); //$NON-NLS-1$ }
/** * Cleans up after {@link #start(BundleContext)} by calling * {@link ArchiveFormats#unregisterAll}. * * @param context * unused */ public void stop(BundleContext context) { ArchiveFormats.unregisterAll(); } }
/** * Registers all included archive formats by calling * {@link ArchiveFormats#registerAll()}. This method is called by the OSGi * framework when the bundle is started. * * @param context * unused */ public void start(BundleContext context) { ArchiveFormats.registerAll(); }
/** * Register all included archive formats so they can be used * as arguments to the ArchiveCommand.setFormat() method. * * Not thread-safe. */ public static void registerAll() { register("tar", new TarFormat()); //$NON-NLS-1$ register("tgz", new TgzFormat()); //$NON-NLS-1$ register("tbz2", new Tbz2Format()); //$NON-NLS-1$ register("txz", new TxzFormat()); //$NON-NLS-1$ register("zip", new ZipFormat()); //$NON-NLS-1$ }
public static void main(String[] args) throws IOException, GitAPIException { try (Repository repository = CookbookHelper.openJGitCookbookRepository()) { // make the included archive formats known ArchiveFormats.registerAll(); try { write(repository, ".zip", "zip"); write(repository, ".tar.gz", "tgz"); write(repository, ".tar.bz2", "tbz2"); write(repository, ".tar.xz", "txz"); } finally { ArchiveFormats.unregisterAll(); } } }