org.eclipse.jgit.api;version="[4.7.0,4.8.0)",
org.eclipse.jgit.lib;version="[4.7.0,4.8.0)",
org.eclipse.jgit.nls;version="[4.7.0,4.8.0)",
+ org.eclipse.jgit.revwalk;version="[4.7.0,4.8.0)",
org.eclipse.jgit.util;version="[4.7.0,4.8.0)",
org.osgi.framework;version="[1.3.0,2.0.0)"
Bundle-ActivationPolicy: lazy
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.archive.internal.ArchiveText;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
/**
return applyFormatOptions(out, o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
+ putEntry(out, null, path, mode,loader);
+ }
+
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
if (mode == FileMode.SYMLINK) {
final TarArchiveEntry entry = new TarArchiveEntry(
path, TarConstants.LF_SYMLINK);
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
/**
return tarFormat.createArchiveOutputStream(out, o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
- tarFormat.putEntry(out, path, mode, loader);
+ putEntry(out, null, path, mode,loader);
+ }
+
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
+ tarFormat.putEntry(out, tree, path, mode, loader);
}
public Iterable<String> suffixes() {
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
/**
return tarFormat.createArchiveOutputStream(out, o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
- tarFormat.putEntry(out, path, mode, loader);
+ putEntry(out, null, path, mode,loader);
+ }
+
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
+ tarFormat.putEntry(out, tree, path, mode, loader);
}
public Iterable<String> suffixes() {
import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream;
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
/**
return tarFormat.createArchiveOutputStream(out, o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
- tarFormat.putEntry(out, path, mode, loader);
+ putEntry(out, null, path, mode,loader);
+ }
+
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
+ tarFormat.putEntry(out, tree, path, mode, loader);
}
public Iterable<String> suffixes() {
import org.eclipse.jgit.api.ArchiveCommand;
import org.eclipse.jgit.archive.internal.ArchiveText;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
+import org.eclipse.jgit.revwalk.RevCommit;
/**
* PKWARE's ZIP format.
return applyFormatOptions(new ZipArchiveOutputStream(s), o);
}
+ @Deprecated
+ @Override
public void putEntry(ArchiveOutputStream out,
String path, FileMode mode, ObjectLoader loader)
throws IOException {
+ putEntry(out, null, path, mode,loader);
+ }
+
+ /**
+ * @since 4.7
+ */
+ @Override
+ public void putEntry(ArchiveOutputStream out,
+ ObjectId tree, String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
// ZipArchiveEntry detects directories by checking
// for '/' at the end of the filename.
if (path.endsWith("/") && mode != FileMode.TREE) //$NON-NLS-1$
path = path + "/"; //$NON-NLS-1$
final ZipArchiveEntry entry = new ZipArchiveEntry(path);
+
+ if(tree instanceof RevCommit){
+ long commitTime = ((RevCommit) tree).getCommitTime();
+ entry.setTime(commitTime);
+ }
+
if (mode == FileMode.TREE) {
out.putArchiveEntry(entry);
out.closeArchiveEntry();
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.util.StringUtils;
private final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".mck"));
+ @Override
public MockOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
return createArchiveOutputStream(s,
Collections.<String, Object> emptyMap());
}
+ @Override
public MockOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
for (Map.Entry<String, Object> p : o.entrySet()) {
return new MockOutputStream();
}
+ @Override
public void putEntry(MockOutputStream out, String path, FileMode mode, ObjectLoader loader) {
+ putEntry(out, null, path, mode, loader);
+ }
+
+ @Override
+ public void putEntry(MockOutputStream out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) {
String content = mode != FileMode.TREE ? new String(loader.getBytes()) : null;
entries.put(path, content);
}
+ @Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.jgit" version="2">
+ <resource path="src/org/eclipse/jgit/api/ArchiveCommand.java" type="org.eclipse.jgit.api.ArchiveCommand$Format">
+ <filter comment="OSGi semver allows to break implementors in minor releases" id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.jgit.api.ArchiveCommand.Format"/>
+ <message_argument value="putEntry(T, ObjectId, String, FileMode, ObjectLoader)"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/jgit/transport/http/HttpConnection.java" type="org.eclipse.jgit.transport.http.HttpConnection">
<filter comment="OSGi semantic versioning rules allow to break implementors in minor releases" id="403767336">
<message_arguments>
* @param out
* archive object from createArchiveOutputStream
* @param path
- * full filename relative to the root of the archive
- * (with trailing '/' for directories)
+ * full filename relative to the root of the archive (with
+ * trailing '/' for directories)
* @param mode
* mode (for example FileMode.REGULAR_FILE or
* FileMode.SYMLINK)
* blob object with data for this entry (null for
* directories)
* @throws IOException
- * thrown by the underlying output stream for I/O errors
+ * thrown by the underlying output stream for I/O errors
+ * @deprecated use
+ * {@link #putEntry(Closeable, ObjectId, String, FileMode, ObjectLoader)}
+ * instead
*/
+ @Deprecated
void putEntry(T out, String path, FileMode mode,
+ ObjectLoader loader) throws IOException;
+
+ /**
+ * Write an entry to an archive.
+ *
+ * @param out
+ * archive object from createArchiveOutputStream
+ * @param tree
+ * the tag, commit, or tree object to produce an archive for
+ * @param path
+ * full filename relative to the root of the archive (with
+ * trailing '/' for directories)
+ * @param mode
+ * mode (for example FileMode.REGULAR_FILE or
+ * FileMode.SYMLINK)
+ * @param loader
+ * blob object with data for this entry (null for
+ * directories)
+ * @throws IOException
+ * thrown by the underlying output stream for I/O errors
+ * @since 4.7
+ */
+ void putEntry(T out, ObjectId tree, String path, FileMode mode,
ObjectLoader loader) throws IOException;
/**
mode = FileMode.TREE;
if (mode == FileMode.TREE) {
- fmt.putEntry(outa, name + "/", mode, null); //$NON-NLS-1$
+ fmt.putEntry(outa, tree, name + "/", mode, null); //$NON-NLS-1$
continue;
}
walk.getObjectId(idBuf, 0);
- fmt.putEntry(outa, name, mode, reader.open(idBuf));
+ fmt.putEntry(outa, tree, name, mode, reader.open(idBuf));
}
outa.close();
return out;