summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2009-10-03 15:43:34 -0700
committerShawn O. Pearce <spearce@spearce.org>2009-10-05 12:17:11 -0700
commit8d5510d51c27d9fccbeb9cfd82f218a5c3ebf530 (patch)
treea5e21c712b8014e72eb2a0b4b857e613ac690b34 /org.eclipse.jgit.pgm
parent3ce8c91e759ee1a9fca1d7b3cb2646b76388de6c (diff)
downloadjgit-8d5510d51c27d9fccbeb9cfd82f218a5c3ebf530.tar.gz
jgit-8d5510d51c27d9fccbeb9cfd82f218a5c3ebf530.zip
Move AmazonS3 command line utility to jgit-pgm
This removes one of the few remaining dependencies on AWTAuthenticator from the core library. For the most part the interface is identical to the prior main method. The jgit-pgm Main class already sets up the HTTP proxy and authenticator for us, so we don't need to do that in our new run method. Change-Id: Ia2cce34d34c97b88214a8bd8f2cc542845e19032 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/META-INF/services/org.eclipse.jgit.pgm.TextBuiltin1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java13
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java11
3 files changed, 25 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/META-INF/services/org.eclipse.jgit.pgm.TextBuiltin b/org.eclipse.jgit.pgm/src/META-INF/services/org.eclipse.jgit.pgm.TextBuiltin
index 9c8933f5d1..6c2a653066 100644
--- a/org.eclipse.jgit.pgm/src/META-INF/services/org.eclipse.jgit.pgm.TextBuiltin
+++ b/org.eclipse.jgit.pgm/src/META-INF/services/org.eclipse.jgit.pgm.TextBuiltin
@@ -1,3 +1,4 @@
+org.eclipse.jgit.pgm.AmazonS3Client
org.eclipse.jgit.pgm.Branch
org.eclipse.jgit.pgm.Clone
org.eclipse.jgit.pgm.Daemon
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java
index e514ca5147..a2f4060821 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2009, Google Inc.
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
* and other copyright owners as documented in the project's IP log.
*
@@ -62,4 +63,16 @@ public class Die extends RuntimeException {
public Die(final String why) {
super(why);
}
+
+ /**
+ * Construct a new message explaining what has gone wrong.
+ *
+ * @param why
+ * the message to show to the end-user.
+ * @param cause
+ * why the command has failed.
+ */
+ public Die(final String why, final Throwable cause) {
+ super(why, cause);
+ }
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
index edd4fbcf9b..13b45e242a 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
@@ -229,6 +229,17 @@ public abstract class TextBuiltin {
return new Die(why);
}
+ /**
+ * @param why
+ * textual explanation
+ * @param cause
+ * why the command has failed.
+ * @return a runtime exception the caller is expected to throw
+ */
+ protected static Die die(final String why, final Throwable cause) {
+ return new Die(why, cause);
+ }
+
String abbreviateRef(String dst, boolean abbreviateRemote) {
if (dst.startsWith(R_HEADS))
dst = dst.substring(R_HEADS.length());