From 8d5510d51c27d9fccbeb9cfd82f218a5c3ebf530 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 3 Oct 2009 15:43:34 -0700 Subject: 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 --- .../src/META-INF/services/org.eclipse.jgit.pgm.TextBuiltin | 1 + org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Die.java | 13 +++++++++++++ .../src/org/eclipse/jgit/pgm/TextBuiltin.java | 11 +++++++++++ 3 files changed, 25 insertions(+) (limited to 'org.eclipse.jgit.pgm') 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 * 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()); -- cgit v1.2.3