This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 54005abfd [#834] enable checkstyle for streampipes-commons (#837)
54005abfd is described below

commit 54005abfdce71c639a8dd9c1945b984d75978b3a
Author: Tim <[email protected]>
AuthorDate: Sun Dec 4 14:26:37 2022 +0100

    [#834] enable checkstyle for streampipes-commons (#837)
---
 streampipes-commons/pom.xml                        | 21 +++++++-
 .../java/org/apache/streampipes/commons/MD5.java   | 58 +++++++++++-----------
 .../exceptions/ElementNotFoundException.java       |  2 +-
 .../RemoteServerNotAccessibleException.java        | 48 +++++++++---------
 .../exceptions/SpConfigurationException.java       |  2 +-
 .../commons/exceptions/SpException.java            |  2 +-
 .../commons/exceptions/SpRuntimeException.java     |  2 +-
 .../commons/exceptions/TooManyEdgesException.java  |  2 +-
 .../commons/exceptions/UserNotFoundException.java  |  2 +-
 .../exceptions/UsernameAlreadyTakenException.java  |  2 +-
 .../streampipes/commons/networking/Networking.java |  6 ++-
 .../streampipes/commons/zip/ZipFileExtractor.java  |  6 ++-
 12 files changed, 89 insertions(+), 64 deletions(-)

diff --git a/streampipes-commons/pom.xml b/streampipes-commons/pom.xml
index 8a9e80b05..e8b142731 100644
--- a/streampipes-commons/pom.xml
+++ b/streampipes-commons/pom.xml
@@ -16,7 +16,8 @@
   ~
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://maven.apache.org/POM/4.0.0";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.streampipes</groupId>
@@ -44,4 +45,22 @@
             <artifactId>logback-classic</artifactId>
         </dependency>
     </dependencies>
+    <build>
+        <extensions>
+            <extension>
+                <groupId>org.apache.maven.archetype</groupId>
+                <artifactId>archetype-packaging</artifactId>
+                <version>3.0.1</version>
+            </extension>
+        </extensions>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <artifactId>maven-archetype-plugin</artifactId>
+                    <version>3.0.1</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
 </project>
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/MD5.java 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/MD5.java
index 2b5fe2c04..9448725b1 100644
--- a/streampipes-commons/src/main/java/org/apache/streampipes/commons/MD5.java
+++ b/streampipes-commons/src/main/java/org/apache/streampipes/commons/MD5.java
@@ -23,40 +23,38 @@ import java.security.NoSuchAlgorithmException;
 
 /**
  * MD5 Tools
- *
- * @author yangdh
  */
 public final class MD5 {
-    /**
-     * Encodes a string
-     *
-     * @param str String to encode
-     * @return Encoded String
-     */
-    public static String crypt(String str) {
-        if (str == null || str.length() == 0) {
-            throw new IllegalArgumentException("String to encrypt cannot be 
null or zero length");
-        }
+  /**
+   * Encodes a string
+   *
+   * @param str String to encode
+   * @return Encoded String
+   */
+  public static String crypt(String str) {
+    if (str == null || str.length() == 0) {
+      throw new IllegalArgumentException("String to encrypt cannot be null or 
zero length");
+    }
 
-        StringBuilder hexString = new StringBuilder();
-
-        try {
-            MessageDigest md = MessageDigest.getInstance("MD5");
-            md.update(str.getBytes());
-            byte[] hash = md.digest();
-
-            for (byte b : hash) {
-                if ((0xff & b) < 0x10) {
-                    hexString.append("0").append(Integer.toHexString((0xFF & 
b)));
-                } else {
-                    hexString.append(Integer.toHexString(0xFF & b));
-                }
-            }
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-        }
+    StringBuilder hexString = new StringBuilder();
 
-        return hexString.toString();
+    try {
+      MessageDigest md = MessageDigest.getInstance("MD5");
+      md.update(str.getBytes());
+      byte[] hash = md.digest();
+
+      for (byte b : hash) {
+        if ((0xff & b) < 0x10) {
+          hexString.append("0").append(Integer.toHexString((0xFF & b)));
+        } else {
+          hexString.append(Integer.toHexString(0xFF & b));
+        }
+      }
+    } catch (NoSuchAlgorithmException e) {
+      e.printStackTrace();
     }
 
+    return hexString.toString();
+  }
+
 }
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/ElementNotFoundException.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/ElementNotFoundException.java
index 4a497d234..390a01190 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/ElementNotFoundException.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/ElementNotFoundException.java
@@ -30,6 +30,6 @@ public class ElementNotFoundException extends Exception {
   }
 
   public ElementNotFoundException(String s) {
-      super(s);
+    super(s);
   }
 }
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/RemoteServerNotAccessibleException.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/RemoteServerNotAccessibleException.java
index 8e31f140a..93c587f45 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/RemoteServerNotAccessibleException.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/RemoteServerNotAccessibleException.java
@@ -20,28 +20,28 @@ package org.apache.streampipes.commons.exceptions;
 
 public class RemoteServerNotAccessibleException extends Exception {
 
-    /**
-     *
-     */
-    private static final long serialVersionUID = 1L;
-
-    private String serverUrl;
-
-    public RemoteServerNotAccessibleException(String message, String 
serverUrl) {
-        super(message);
-        this.serverUrl = serverUrl;
-    }
-
-    public 
RemoteServerNotAccessibleException(RemoteServerNotAccessibleException e) {
-        super(e.getMessage());
-        this.serverUrl = e.getServerUrl();
-    }
-
-    public String getServerUrl() {
-        return serverUrl;
-    }
-
-    public void setServerUrl(String serverUrl) {
-        this.serverUrl = serverUrl;
-    }
+  /**
+   *
+   */
+  private static final long serialVersionUID = 1L;
+
+  private String serverUrl;
+
+  public RemoteServerNotAccessibleException(String message, String serverUrl) {
+    super(message);
+    this.serverUrl = serverUrl;
+  }
+
+  public RemoteServerNotAccessibleException(RemoteServerNotAccessibleException 
e) {
+    super(e.getMessage());
+    this.serverUrl = e.getServerUrl();
+  }
+
+  public String getServerUrl() {
+    return serverUrl;
+  }
+
+  public void setServerUrl(String serverUrl) {
+    this.serverUrl = serverUrl;
+  }
 }
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpConfigurationException.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpConfigurationException.java
index 321330b51..0fed3fc3b 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpConfigurationException.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpConfigurationException.java
@@ -42,7 +42,7 @@ public class SpConfigurationException extends Exception {
    * Creates a new exception with the given message and cause
    *
    * @param message The exception message
-   * @param cause The exception that caused this exception
+   * @param cause   The exception that caused this exception
    */
   public SpConfigurationException(String message, Throwable cause) {
     super(message, cause);
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpException.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpException.java
index 5c877d0a9..18ca1cc19 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpException.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpException.java
@@ -44,7 +44,7 @@ public class SpException extends RuntimeException {
    * Creates a new exception with the given message and cause
    *
    * @param message The exception message
-   * @param cause The exception that caused this exception
+   * @param cause   The exception that caused this exception
    */
   public SpException(String message, Throwable cause) {
     super(message, cause);
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpRuntimeException.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpRuntimeException.java
index 15fdd523e..0ec167bd2 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpRuntimeException.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/SpRuntimeException.java
@@ -44,7 +44,7 @@ public class SpRuntimeException extends SpException {
    * Creates a new exception with the given message and cause
    *
    * @param message The exception message
-   * @param cause The exception that caused this exception
+   * @param cause   The exception that caused this exception
    */
   public SpRuntimeException(String message, Throwable cause) {
     super(message, cause);
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/TooManyEdgesException.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/TooManyEdgesException.java
index 4ebb6a85e..5b406f0b1 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/TooManyEdgesException.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/TooManyEdgesException.java
@@ -18,6 +18,6 @@
 
 package org.apache.streampipes.commons.exceptions;
 
-public class TooManyEdgesException extends Exception{
+public class TooManyEdgesException extends Exception {
 
 }
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/UserNotFoundException.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/UserNotFoundException.java
index 5c6517846..6c5604f8f 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/UserNotFoundException.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/UserNotFoundException.java
@@ -17,7 +17,7 @@
  */
 package org.apache.streampipes.commons.exceptions;
 
-public class UserNotFoundException extends SpException{
+public class UserNotFoundException extends SpException {
   public UserNotFoundException(String message) {
     super(message);
   }
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/UsernameAlreadyTakenException.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/UsernameAlreadyTakenException.java
index f2328e26e..cf97871f2 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/UsernameAlreadyTakenException.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/exceptions/UsernameAlreadyTakenException.java
@@ -17,7 +17,7 @@
  */
 package org.apache.streampipes.commons.exceptions;
 
-public class UsernameAlreadyTakenException extends SpException{
+public class UsernameAlreadyTakenException extends SpException {
   public UsernameAlreadyTakenException(String message) {
     super(message);
   }
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/networking/Networking.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/networking/Networking.java
index bb9834993..4034c3a9c 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/networking/Networking.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/networking/Networking.java
@@ -18,11 +18,15 @@
 package org.apache.streampipes.commons.networking;
 
 import org.apache.streampipes.commons.constants.Envs;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.net.*;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
 
 public class Networking {
 
diff --git 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/zip/ZipFileExtractor.java
 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/zip/ZipFileExtractor.java
index 12e5af641..587d19f7e 100644
--- 
a/streampipes-commons/src/main/java/org/apache/streampipes/commons/zip/ZipFileExtractor.java
+++ 
b/streampipes-commons/src/main/java/org/apache/streampipes/commons/zip/ZipFileExtractor.java
@@ -17,7 +17,11 @@
  */
 package org.apache.streampipes.commons.zip;
 
-import java.io.*;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.zip.ZipEntry;

Reply via email to