diff options
author | Code Review <codereview-daemon@eclipse.org> | 2009-10-05 17:29:56 -0400 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2009-10-05 17:29:56 -0400 |
commit | 6e1571d5b9269ec79eadad0dbd5916508a4fee82 (patch) | |
tree | d947ce0de06ce4a6ee12734ec5b291ccfb216260 /org.eclipse.jgit | |
parent | 9b48eb940a255850e2440ebb14a94ce1bda6e9e0 (diff) | |
parent | 41e4b2fed4cf8da887fb5384f61bda823c51970c (diff) | |
download | jgit-6e1571d5b9269ec79eadad0dbd5916508a4fee82.tar.gz jgit-6e1571d5b9269ec79eadad0dbd5916508a4fee82.zip |
Merge changes I282ee1c6,I5700ca48,Ic243544a,Ia2cce34d,I2fd81be2
* changes:
Move HttpSupport's configureHttpProxy to jgit-pgm
Move AmazonS3 command line utility to jgit-pgm
Move setupReflog test function to only test that cares
Remove useless test005_todopack test
Standardize the source code formatter for Eclipse
Diffstat (limited to 'org.eclipse.jgit')
4 files changed, 17 insertions, 112 deletions
diff --git a/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs index 8e8e17240c..76557139ec 100644 --- a/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Sun Mar 15 01:13:43 CET 2009 +#Fri Oct 02 18:43:47 PDT 2009 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 @@ -103,6 +103,7 @@ org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 org.eclipse.jdt.core.formatter.blank_lines_before_method=1 org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line @@ -116,9 +117,14 @@ org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true org.eclipse.jdt.core.formatter.comment.format_comments=true org.eclipse.jdt.core.formatter.comment.format_header=false org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true org.eclipse.jdt.core.formatter.comment.format_source_code=true org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true org.eclipse.jdt.core.formatter.comment.indent_root_tags=true @@ -141,6 +147,9 @@ org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false org.eclipse.jdt.core.formatter.indentation.size=4 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert @@ -293,6 +302,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=inser org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert @@ -313,9 +323,12 @@ org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false org.eclipse.jdt.core.formatter.lineSplit=80 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true org.eclipse.jdt.core.formatter.tabulation.char=tab org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/org.eclipse.jgit/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jgit/.settings/org.eclipse.jdt.ui.prefs index 709a44074c..056d54651d 100644 --- a/org.eclipse.jgit/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.jgit/.settings/org.eclipse.jdt.ui.prefs @@ -1,7 +1,7 @@ -#Wed May 09 00:20:24 CEST 2007 +#Fri Oct 02 18:44:57 PDT 2009 eclipse.preferences.version=1 -formatter_profile=_JGit -formatter_settings_version=10 +formatter_profile=_JGit Format +formatter_settings_version=11 org.eclipse.jdt.ui.ignorelowercasenames=true org.eclipse.jdt.ui.importorder=java;javax;org;com; org.eclipse.jdt.ui.ondemandthreshold=99 diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java index 9343f4aba4..46ebf82552 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java @@ -44,7 +44,6 @@ package org.eclipse.jgit.transport; import java.io.ByteArrayOutputStream; -import java.io.EOFException; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -79,7 +78,6 @@ import java.util.TreeMap; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; -import org.eclipse.jgit.awtui.AwtAuthenticator; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.ProgressMonitor; @@ -623,70 +621,6 @@ public class AmazonS3 { c.setRequestProperty("Authorization", "AWS " + publicKey + ":" + sec); } - /** - * Simple command line interface to {@link AmazonS3}. - * - * @param argv - * command line arguments. See usage for details. - * @throws IOException - * an error occurred. - */ - public static void main(final String[] argv) throws IOException { - if (argv.length != 4) { - commandLineUsage(); - return; - } - - AwtAuthenticator.install(); - HttpSupport.configureHttpProxy(); - - final AmazonS3 s3 = new AmazonS3(properties(new File(argv[0]))); - final String op = argv[1]; - final String bucket = argv[2]; - final String key = argv[3]; - if ("get".equals(op)) { - final URLConnection c = s3.get(bucket, key); - int len = c.getContentLength(); - final InputStream in = c.getInputStream(); - try { - final byte[] tmp = new byte[2048]; - while (len > 0) { - final int n = in.read(tmp); - if (n < 0) - throw new EOFException("Expected " + len + " bytes."); - System.out.write(tmp, 0, n); - len -= n; - } - } finally { - in.close(); - } - } else if ("ls".equals(op) || "list".equals(op)) { - for (final String k : s3.list(bucket, key)) - System.out.println(k); - } else if ("rm".equals(op) || "delete".equals(op)) { - s3.delete(bucket, key); - } else if ("put".equals(op)) { - final OutputStream os = s3.beginPut(bucket, key, null, null); - final byte[] tmp = new byte[2048]; - int n; - while ((n = System.in.read(tmp)) > 0) - os.write(tmp, 0, n); - os.close(); - } else { - commandLineUsage(); - } - } - - private static void commandLineUsage() { - System.err.println("usage: conn.prop op bucket key"); - System.err.println(); - System.err.println(" where conn.prop is a jets3t properties file."); - System.err.println(" op is one of: get ls rm put"); - System.err.println(" bucket is the name of the S3 bucket"); - System.err.println(" key is the name of the object."); - System.exit(1); - } - static Properties properties(final File authFile) throws FileNotFoundException, IOException { final Properties p = new Properties(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java index 40134d0e4f..3910c8bd7f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java @@ -47,57 +47,15 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.ConnectException; import java.net.HttpURLConnection; -import java.net.MalformedURLException; import java.net.Proxy; import java.net.ProxySelector; import java.net.URISyntaxException; import java.net.URL; import java.net.URLEncoder; -import org.eclipse.jgit.awtui.AwtAuthenticator; - /** Extra utilities to support usage of HTTP. */ public class HttpSupport { /** - * Configure the JRE's standard HTTP based on <code>http_proxy</code>. - * <p> - * The popular libcurl library honors the <code>http_proxy</code> - * environment variable as a means of specifying an HTTP proxy for requests - * made behind a firewall. This is not natively recognized by the JRE, so - * this method can be used by command line utilities to configure the JRE - * before the first request is sent. - * - * @throws MalformedURLException - * the value in <code>http_proxy</code> is unsupportable. - */ - public static void configureHttpProxy() throws MalformedURLException { - final String s = System.getenv("http_proxy"); - if (s == null || s.equals("")) - return; - - final URL u = new URL((s.indexOf("://") == -1) ? "http://" + s : s); - if (!"http".equals(u.getProtocol())) - throw new MalformedURLException("Invalid http_proxy: " + s - + ": Only http supported."); - - final String proxyHost = u.getHost(); - final int proxyPort = u.getPort(); - - System.setProperty("http.proxyHost", proxyHost); - if (proxyPort > 0) - System.setProperty("http.proxyPort", String.valueOf(proxyPort)); - - final String userpass = u.getUserInfo(); - if (userpass != null && userpass.contains(":")) { - final int c = userpass.indexOf(':'); - final String user = userpass.substring(0, c); - final String pass = userpass.substring(c + 1); - AwtAuthenticator.add(new AwtAuthenticator.CachedAuthentication( - proxyHost, proxyPort, user, pass)); - } - } - - /** * URL encode a value string into an output buffer. * * @param urlstr |