You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2014/05/14 10:22:51 UTC

git commit: Address checkstyle violations

Repository: jclouds-labs
Updated Branches:
  refs/heads/master e255b82ce -> 249bb586e


Address checkstyle violations


Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/249bb586
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/249bb586
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/249bb586

Branch: refs/heads/master
Commit: 249bb586e820b4ca7ccd2fd78fd0ed3f865f12ca
Parents: e255b82
Author: Ignasi Barrera <na...@apache.org>
Authored: Tue May 13 10:48:00 2014 +0200
Committer: Ignasi Barrera <na...@apache.org>
Committed: Tue May 13 10:48:04 2014 +0200

----------------------------------------------------------------------
 ...plateOptionsToStatementWithoutPublicKey.java |  3 +-
 .../handlers/DigitalOceanErrorHandler.java      |  2 +-
 .../org/jclouds/digitalocean/ssh/DSAKeys.java   | 44 ++++++++------------
 .../DigitalOceanComputeServiceLiveTest.java     |  2 +-
 .../DigitalOceanImageExtensionLiveTest.java     |  2 +-
 5 files changed, 23 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/249bb586/digitalocean/src/main/java/org/jclouds/digitalocean/compute/functions/TemplateOptionsToStatementWithoutPublicKey.java
----------------------------------------------------------------------
diff --git a/digitalocean/src/main/java/org/jclouds/digitalocean/compute/functions/TemplateOptionsToStatementWithoutPublicKey.java b/digitalocean/src/main/java/org/jclouds/digitalocean/compute/functions/TemplateOptionsToStatementWithoutPublicKey.java
index 96761eb..1a01811 100644
--- a/digitalocean/src/main/java/org/jclouds/digitalocean/compute/functions/TemplateOptionsToStatementWithoutPublicKey.java
+++ b/digitalocean/src/main/java/org/jclouds/digitalocean/compute/functions/TemplateOptionsToStatementWithoutPublicKey.java
@@ -30,7 +30,8 @@ import com.google.common.collect.ImmutableList;
 /**
  * Convert the template options into a statement, but ignoring the public key.
  * <p>
- * The {@link DigitalOceanComputeServiceAdapter} already takes care of installing it using the {@link KeyPairApi}.
+ * The {@link org.jclouds.digitalocean.compute.strategy.DigitalOceanComputeServiceAdapter} already takes care of
+ * installing it using the {@link org.jclouds.digitalocean.features.KeyPairApi}.
  * 
  * @author Sergi Castro
  * @author Ignasi Barrera

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/249bb586/digitalocean/src/main/java/org/jclouds/digitalocean/handlers/DigitalOceanErrorHandler.java
----------------------------------------------------------------------
diff --git a/digitalocean/src/main/java/org/jclouds/digitalocean/handlers/DigitalOceanErrorHandler.java b/digitalocean/src/main/java/org/jclouds/digitalocean/handlers/DigitalOceanErrorHandler.java
index d55c086..3c8ec70 100644
--- a/digitalocean/src/main/java/org/jclouds/digitalocean/handlers/DigitalOceanErrorHandler.java
+++ b/digitalocean/src/main/java/org/jclouds/digitalocean/handlers/DigitalOceanErrorHandler.java
@@ -31,7 +31,7 @@ import org.jclouds.rest.ResourceNotFoundException;
  * @author Sergi Castro
  * @author Ignasi Barrera
  * 
- * @see ResponseStatusFromPayloadHttpCommandExecutorService
+ * @see org.jclouds.digitalocean.http.ResponseStatusFromPayloadHttpCommandExecutorService
  */
 @Singleton
 public class DigitalOceanErrorHandler implements HttpErrorHandler {

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/249bb586/digitalocean/src/main/java/org/jclouds/digitalocean/ssh/DSAKeys.java
----------------------------------------------------------------------
diff --git a/digitalocean/src/main/java/org/jclouds/digitalocean/ssh/DSAKeys.java b/digitalocean/src/main/java/org/jclouds/digitalocean/ssh/DSAKeys.java
index 2db7e70..3d65d87 100644
--- a/digitalocean/src/main/java/org/jclouds/digitalocean/ssh/DSAKeys.java
+++ b/digitalocean/src/main/java/org/jclouds/digitalocean/ssh/DSAKeys.java
@@ -39,18 +39,17 @@ import com.google.common.base.Charsets;
 import com.google.common.base.Splitter;
 import com.google.common.hash.HashCode;
 import com.google.common.hash.Hashing;
-import com.google.common.io.ByteStreams;
-import com.google.common.io.InputSupplier;
+import com.google.common.io.ByteSource;
 
 /**
  * Utility methods to work with DSA SSH keys.
  * <p>
- * Methods in this class should be moved to the {@link SshKeys} class.
+ * Methods in this class should be moved to the {@link org.jclouds.ssh.SshKeys} class.
  * 
  * @author Sergi Castro
  * @author Ignasi Barrera
  * 
- * @see SshKeys
+ * @see org.jclouds.ssh.SshKeys
  */
 public class DSAKeys {
 
@@ -61,34 +60,30 @@ public class DSAKeys {
    }
 
    /**
-    * Executes {@link Pems#publicKeySpecFromOpenSSH(InputSupplier)} on the
+    * Executes {@link org.jclouds.crypto.Pems#publicKeySpecFromOpenSSH(com.google.common.io.InputSupplier)} on the
     * string which was OpenSSH Base64 Encoded {@code id_rsa.pub}
     * 
     * @param idRsaPub formatted {@code ssh-dss AAAAB3NzaC1yc2EAAAADAQABAAAB...}
-    * @see Pems#publicKeySpecFromOpenSSH(InputSupplier)
+    * @see org.jclouds.crypto.Pems#publicKeySpecFromOpenSSH(com.google.common.io.InputSupplier)
     */
    public static DSAPublicKeySpec publicKeySpecFromOpenSSH(String idDsaPub) {
       try {
-         return publicKeySpecFromOpenSSH(ByteStreams.newInputStreamSupplier(idDsaPub.getBytes(Charsets.UTF_8)));
+         return publicKeySpecFromOpenSSH(ByteSource.wrap(idDsaPub.getBytes(Charsets.UTF_8)));
       } catch (IOException e) {
          throw propagate(e);
       }
    }
 
    /**
-    * Returns {@link DSAPublicKeySpec} which was OpenSSH Base64 Encoded
-    * {@code id_rsa.pub}
+    * Returns {@link DSAPublicKeySpec} which was OpenSSH Base64 Encoded {@code id_rsa.pub}
     * 
-    * @param supplier the input stream factory, formatted
-    *        {@code ssh-dss AAAAB3NzaC1yc2EAAAADAQABAAAB...}
+    * @param supplier the input stream factory, formatted {@code ssh-dss AAAAB3NzaC1yc2EAAAADAQABAAAB...}
     * 
-    * @return the {@link DSAPublicKeySpec} which was OpenSSH Base64 Encoded
-    *         {@code id_rsa.pub}
+    * @return the {@link DSAPublicKeySpec} which was OpenSSH Base64 Encoded {@code id_rsa.pub}
     * @throws IOException if an I/O error occurs
     */
-   public static DSAPublicKeySpec publicKeySpecFromOpenSSH(InputSupplier<? extends InputStream> supplier)
-         throws IOException {
-      InputStream stream = supplier.getInput();
+   public static DSAPublicKeySpec publicKeySpecFromOpenSSH(ByteSource supplier) throws IOException {
+      InputStream stream = supplier.openStream();
       Iterable<String> parts = Splitter.on(' ').split(toStringAndClose(stream).trim());
       checkArgument(size(parts) >= 2 && "ssh-dss".equals(get(parts, 0)), "bad format, should be: ssh-dss AAAAB3...");
       stream = new ByteArrayInputStream(base64().decode(get(parts, 1)));
@@ -103,8 +98,7 @@ public class DSAKeys {
 
    /**
     * @param publicKeyOpenSSH RSA public key in OpenSSH format
-    * @return fingerprint ex.
-    *         {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9}
+    * @return fingerprint ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9}
     */
    public static String fingerprintPublicKey(String publicKeyOpenSSH) {
       DSAPublicKeySpec publicKeySpec = publicKeySpecFromOpenSSH(publicKeyOpenSSH);
@@ -112,12 +106,10 @@ public class DSAKeys {
    }
 
    /**
-    * Create a fingerprint per the following <a
-    * href="http://tools.ietf.org/html/draft-friedl-secsh-fingerprint-00"
+    * Create a fingerprint per the following <a href="http://tools.ietf.org/html/draft-friedl-secsh-fingerprint-00"
     * >spec</a>
     * 
-    * @return hex fingerprint ex.
-    *         {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9}
+    * @return hex fingerprint ex. {@code 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9}
     */
    public static String fingerprint(BigInteger p, BigInteger q, BigInteger g, BigInteger y) {
       byte[] keyBlob = keyBlob(p, q, g, y);
@@ -125,14 +117,14 @@ public class DSAKeys {
    }
 
    /**
-    * @see SshKeys
+    * @see org.jclouds.ssh.SshKeys
     */
    private static String hexColonDelimited(HashCode hc) {
       return on(':').join(fixedLength(2).split(base16().lowerCase().encode(hc.asBytes())));
    }
 
    /**
-    * @see SshKeys
+    * @see org.jclouds.ssh.SshKeys
     */
    private static byte[] keyBlob(BigInteger p, BigInteger q, BigInteger g, BigInteger y) {
       try {
@@ -149,7 +141,7 @@ public class DSAKeys {
    }
 
    /**
-    * @see SshKeys
+    * @see org.jclouds.ssh.SshKeys
     */
    // http://www.ietf.org/rfc/rfc4253.txt
    private static byte[] readLengthFirst(InputStream in) throws IOException {
@@ -164,7 +156,7 @@ public class DSAKeys {
    }
 
    /**
-    * @see SshKeys
+    * @see org.jclouds.ssh.SshKeys
     */
    // http://www.ietf.org/rfc/rfc4253.txt
    private static void writeLengthFirst(byte[] array, ByteArrayOutputStream out) throws IOException {

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/249bb586/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanComputeServiceLiveTest.java
----------------------------------------------------------------------
diff --git a/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanComputeServiceLiveTest.java b/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanComputeServiceLiveTest.java
index baaa70b..ff4a3d2 100644
--- a/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanComputeServiceLiveTest.java
+++ b/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanComputeServiceLiveTest.java
@@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableSet;
 import com.google.inject.Module;
 
 /**
- * Live tests for the {@link ComputeService} integration.
+ * Live tests for the {@link org.jclouds.compute.ComputeService} integration.
  * 
  * @author Sergi Castro
  * @author Ignasi Barrera

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/249bb586/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanImageExtensionLiveTest.java
----------------------------------------------------------------------
diff --git a/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanImageExtensionLiveTest.java b/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanImageExtensionLiveTest.java
index f081f25..fde0366 100644
--- a/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanImageExtensionLiveTest.java
+++ b/digitalocean/src/test/java/org/jclouds/digitalocean/compute/DigitalOceanImageExtensionLiveTest.java
@@ -23,7 +23,7 @@ import org.testng.annotations.Test;
 import com.google.inject.Module;
 
 /**
- * Live tests for the {@link ImageExtension} integration.
+ * Live tests for the {@link org.jclouds.compute.extensions.ImageExtension} integration.
  * 
  * @author Sergi Castro
  * @author Ignasi Barrera