diff options
Diffstat (limited to 'org.eclipse.jgit.archive/src/org/eclipse/jgit/archive')
7 files changed, 22 insertions, 45 deletions
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/BaseFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/BaseFormat.java index 0ebac77228..4757998a29 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/BaseFormat.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/BaseFormat.java @@ -15,6 +15,7 @@ import java.io.IOException; import java.text.MessageFormat; import java.util.Map; +import org.apache.commons.compress.archivers.ArchiveEntry; import org.apache.commons.compress.archivers.ArchiveOutputStream; import org.eclipse.jgit.archive.internal.ArchiveText; import org.eclipse.jgit.util.StringUtils; @@ -40,8 +41,10 @@ public class BaseFormat { * options map * @return stream with option applied * @throws IOException + * if an IO error occurred */ - protected ArchiveOutputStream applyFormatOptions(ArchiveOutputStream s, + protected ArchiveOutputStream<? extends ArchiveEntry> applyFormatOptions( + ArchiveOutputStream<? extends ArchiveEntry> s, Map<String, Object> o) throws IOException { for (Map.Entry<String, Object> p : o.entrySet()) { try { diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java index 702bad62fe..3db1124752 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java @@ -35,11 +35,10 @@ import org.eclipse.jgit.revwalk.RevCommit; * Unix TAR format (ustar + some PAX extensions). */ public final class TarFormat extends BaseFormat implements - ArchiveCommand.Format<ArchiveOutputStream> { + ArchiveCommand.Format<ArchiveOutputStream<TarArchiveEntry>> { private static final List<String> SUFFIXES = Collections .unmodifiableList(Arrays.asList(".tar")); //$NON-NLS-1$ - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s) throws IOException { @@ -47,7 +46,6 @@ public final class TarFormat extends BaseFormat implements Collections.<String, Object> emptyMap()); } - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s, Map<String, Object> o) throws IOException { @@ -58,9 +56,8 @@ public final class TarFormat extends BaseFormat implements return applyFormatOptions(out, o); } - /** {@inheritDoc} */ @Override - public void putEntry(ArchiveOutputStream out, + public void putEntry(ArchiveOutputStream<TarArchiveEntry> out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) throws IOException { if (mode == FileMode.SYMLINK) { @@ -108,19 +105,16 @@ public final class TarFormat extends BaseFormat implements out.closeArchiveEntry(); } - /** {@inheritDoc} */ @Override public Iterable<String> suffixes() { return SUFFIXES; } - /** {@inheritDoc} */ @Override public boolean equals(Object other) { return (other instanceof TarFormat); } - /** {@inheritDoc} */ @Override public int hashCode() { return getClass().hashCode(); diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java index 940dafd40f..03a2305e2b 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.Map; import org.apache.commons.compress.archivers.ArchiveOutputStream; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream; import org.eclipse.jgit.api.ArchiveCommand; import org.eclipse.jgit.lib.FileMode; @@ -26,14 +27,13 @@ import org.eclipse.jgit.lib.ObjectLoader; /** * bzip2-compressed tarball (tar.bz2) format. */ -public final class Tbz2Format extends BaseFormat implements - ArchiveCommand.Format<ArchiveOutputStream> { +public final class Tbz2Format extends BaseFormat + implements ArchiveCommand.Format<ArchiveOutputStream<TarArchiveEntry>> { private static final List<String> SUFFIXES = Collections .unmodifiableList(Arrays.asList(".tar.bz2", ".tbz", ".tbz2")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat(); + private final ArchiveCommand.Format<ArchiveOutputStream<TarArchiveEntry>> tarFormat = new TarFormat(); - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s) throws IOException { @@ -41,7 +41,6 @@ public final class Tbz2Format extends BaseFormat implements Collections.<String, Object> emptyMap()); } - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s, Map<String, Object> o) throws IOException { @@ -55,27 +54,23 @@ public final class Tbz2Format extends BaseFormat implements return tarFormat.createArchiveOutputStream(out, o); } - /** {@inheritDoc} */ @Override - public void putEntry(ArchiveOutputStream out, + public void putEntry(ArchiveOutputStream<TarArchiveEntry> out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) throws IOException { tarFormat.putEntry(out, tree, path, mode, loader); } - /** {@inheritDoc} */ @Override public Iterable<String> suffixes() { return SUFFIXES; } - /** {@inheritDoc} */ @Override public boolean equals(Object other) { return (other instanceof Tbz2Format); } - /** {@inheritDoc} */ @Override public int hashCode() { return getClass().hashCode(); diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java index 72e2439f68..6ce9c1e748 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.Map; import org.apache.commons.compress.archivers.ArchiveOutputStream; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; import org.apache.commons.compress.compressors.gzip.GzipParameters; import org.eclipse.jgit.api.ArchiveCommand; @@ -27,14 +28,13 @@ import org.eclipse.jgit.lib.ObjectLoader; /** * gzip-compressed tarball (tar.gz) format. */ -public final class TgzFormat extends BaseFormat implements - ArchiveCommand.Format<ArchiveOutputStream> { +public final class TgzFormat extends BaseFormat + implements ArchiveCommand.Format<ArchiveOutputStream<TarArchiveEntry>> { private static final List<String> SUFFIXES = Collections .unmodifiableList(Arrays.asList(".tar.gz", ".tgz")); //$NON-NLS-1$ //$NON-NLS-2$ - private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat(); + private final ArchiveCommand.Format<ArchiveOutputStream<TarArchiveEntry>> tarFormat = new TarFormat(); - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s) throws IOException { @@ -42,7 +42,6 @@ public final class TgzFormat extends BaseFormat implements Collections.<String, Object> emptyMap()); } - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s, Map<String, Object> o) throws IOException { @@ -58,27 +57,23 @@ public final class TgzFormat extends BaseFormat implements return tarFormat.createArchiveOutputStream(out, o); } - /** {@inheritDoc} */ @Override - public void putEntry(ArchiveOutputStream out, + public void putEntry(ArchiveOutputStream<TarArchiveEntry> out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) throws IOException { tarFormat.putEntry(out, tree, path, mode, loader); } - /** {@inheritDoc} */ @Override public Iterable<String> suffixes() { return SUFFIXES; } - /** {@inheritDoc} */ @Override public boolean equals(Object other) { return (other instanceof TgzFormat); } - /** {@inheritDoc} */ @Override public int hashCode() { return getClass().hashCode(); diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java index b16fb6dcbd..f51f904bc7 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.Map; import org.apache.commons.compress.archivers.ArchiveOutputStream; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream; import org.eclipse.jgit.api.ArchiveCommand; import org.eclipse.jgit.lib.FileMode; @@ -26,14 +27,13 @@ import org.eclipse.jgit.lib.ObjectLoader; /** * Xz-compressed tar (tar.xz) format. */ -public final class TxzFormat extends BaseFormat implements - ArchiveCommand.Format<ArchiveOutputStream> { +public final class TxzFormat extends BaseFormat + implements ArchiveCommand.Format<ArchiveOutputStream<TarArchiveEntry>> { private static final List<String> SUFFIXES = Collections .unmodifiableList(Arrays.asList(".tar.xz", ".txz")); //$NON-NLS-1$ //$NON-NLS-2$ - private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat(); + private final ArchiveCommand.Format<ArchiveOutputStream<TarArchiveEntry>> tarFormat = new TarFormat(); - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s) throws IOException { @@ -41,7 +41,6 @@ public final class TxzFormat extends BaseFormat implements Collections.<String, Object> emptyMap()); } - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s, Map<String, Object> o) throws IOException { @@ -55,27 +54,23 @@ public final class TxzFormat extends BaseFormat implements return tarFormat.createArchiveOutputStream(out, o); } - /** {@inheritDoc} */ @Override - public void putEntry(ArchiveOutputStream out, + public void putEntry(ArchiveOutputStream<TarArchiveEntry> out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) throws IOException { tarFormat.putEntry(out, tree, path, mode, loader); } - /** {@inheritDoc} */ @Override public Iterable<String> suffixes() { return SUFFIXES; } - /** {@inheritDoc} */ @Override public boolean equals(Object other) { return (other instanceof TxzFormat); } - /** {@inheritDoc} */ @Override public int hashCode() { return getClass().hashCode(); diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java index 97a24c75cb..6cb42ae1e5 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java @@ -35,7 +35,6 @@ public final class ZipFormat extends BaseFormat implements private static final List<String> SUFFIXES = Collections .unmodifiableList(Arrays.asList(".zip")); //$NON-NLS-1$ - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s) throws IOException { @@ -43,7 +42,6 @@ public final class ZipFormat extends BaseFormat implements Collections.<String, Object> emptyMap()); } - /** {@inheritDoc} */ @Override public ArchiveOutputStream createArchiveOutputStream(OutputStream s, Map<String, Object> o) throws IOException { @@ -55,7 +53,6 @@ public final class ZipFormat extends BaseFormat implements return applyFormatOptions(out, o); } - /** {@inheritDoc} */ @Override public void putEntry(ArchiveOutputStream out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) @@ -97,19 +94,16 @@ public final class ZipFormat extends BaseFormat implements out.closeArchiveEntry(); } - /** {@inheritDoc} */ @Override public Iterable<String> suffixes() { return SUFFIXES; } - /** {@inheritDoc} */ @Override public boolean equals(Object other) { return (other instanceof ZipFormat); } - /** {@inheritDoc} */ @Override public int hashCode() { return getClass().hashCode(); diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/internal/ArchiveText.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/internal/ArchiveText.java index 551646bcdc..4d63c23d11 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/internal/ArchiveText.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/internal/ArchiveText.java @@ -16,6 +16,7 @@ import org.eclipse.jgit.nls.TranslationBundle; /** * Translation bundle for archivers */ +@SuppressWarnings("MissingSummary") public class ArchiveText extends TranslationBundle { /** * Get an instance of this translation bundle. |