Skip to content

Commit

Permalink
Added constructor that throws Exception with relevant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sangupta committed May 14, 2019
1 parent 454ef03 commit 81df6ca
Show file tree
Hide file tree
Showing 67 changed files with 288 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ArchiveUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
*
*/
public abstract class ArchiveUtils {

protected ArchiveUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Logger
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/AssertUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
* @since 1.0.0
*/
public abstract class AssertUtils {

protected AssertUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Check if a given string is <code>null</code> or zero-length. Returns
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/BitUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
*
*/
public abstract class BitUtils {

protected BitUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

private static final int LEAST_BIT = 0;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ByteArrayUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
*
*/
public abstract class ByteArrayUtils {

protected ByteArrayUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Read a long value from given byte-array at the given offset. The value is
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/CheckUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
* @since 1.2.0
*/
public abstract class CheckUtils {

protected CheckUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Check whether the file represented by the given absolute file path is a
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/CompressionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
*
*/
public abstract class CompressionUtils {

protected CompressionUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* The logger
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ConsoleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
*
*/
public abstract class ConsoleUtils {

protected ConsoleUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

private static BufferedReader reader;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/CookieUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
*
*/
public abstract class CookieUtils {

protected CookieUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Create a new cookie. The cookie will expire at the end of browser
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/CryptoUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
*
*/
public abstract class CryptoUtils {

protected CryptoUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* AES-256 encrypt the text.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/DateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
*
*/
public abstract class DateUtils {

protected DateUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* One second expressed as millis
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/DesktopUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
*
*/
public abstract class DesktopUtils {

protected DesktopUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Open the given URL in the system web browser.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/DomUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
*
*/
public abstract class DomUtils {

protected DomUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Returns the value of the attribute from the element.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/DumpUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
*
*/
public abstract class DumpUtils {

protected DumpUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Returns the string representation of the given object by invoking the
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/EnvironmentUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
*
*/
public abstract class EnvironmentUtils {

protected EnvironmentUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Read an environment variable first from the java command line, and then
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/EqualUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
*
*/
public abstract class EqualUtils {

protected EqualUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Tests if two <code>byte</code> arrays are equal in content or not.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
*
*/
public abstract class FileUtils {

protected FileUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* One KB as number of bytes
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/GsonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
* @since 1.0.0
*/
public abstract class GsonUtils {

protected GsonUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Our holder for multiple instances
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/HashUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
*
*/
public abstract class HashUtils {

protected HashUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Computes the MD5 hash of the given data.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/HtmlUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
*
*/
public abstract class HtmlUtils {

protected HtmlUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Tidy the HTML source by reformatting the entire HTML. This is
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
* @since 3.1.0
*/
public abstract class IOUtils {

protected IOUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

public static void closeQuietly(Closeable... closeables) {
if (AssertUtils.isEmpty(closeables)) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/JDKUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
*
*/
public abstract class JDKUtils {

protected JDKUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Check if JDK version is 1.7 or not
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ListUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
* @since 2.2
*/
public abstract class ListUtils {

protected ListUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Create a new list of integer values.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/MimeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
*
*/
public abstract class MimeUtils implements HttpMimeType {

protected MimeUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Mappings between extension and MIME type
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/NumberUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
import java.math.RoundingMode;

public class NumberUtils {

protected NumberUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Returns the {@code int} value that is equal to {@code value}, if
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/OSUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
*
*/
public abstract class OSUtils {

protected OSUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Global enum depicting the current OS the JVM is running in.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ObjectUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
*
*/
public abstract class ObjectUtils {

protected ObjectUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Check if the object represents a primitive type of: <code>byte</code>,
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/PropertiesUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
*
*/
public abstract class PropertiesUtils {

protected PropertiesUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Convert a given {@link Properties} instance to a corresponding
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/RangeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
* @since 2.3
*/
public abstract class RangeUtils {

protected RangeUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Check if a character is in the given range.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ReadableUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
*
*/
public abstract class ReadableUtils {

protected ReadableUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Convert human readable file size to number of bytes. For example: 2k
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ReflectionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
*
*/
public abstract class ReflectionUtils {

protected ReflectionUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

private static final Logger LOGGER = LoggerFactory.getLogger(ReflectionUtils.class);

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/RequestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
*
*/
public abstract class RequestUtils {

protected RequestUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Extract the base URI and strip off the context path as well as any
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ResourceUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
*/
public class ResourceUtils {

protected ResourceUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Read the file at given {@link Path} as a {@link String} in default
* encoding.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/ResponseUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
*
*/
public abstract class ResponseUtils {

protected ResponseUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Write the given response in UTF-8 encoding to the given
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
*
*/
public abstract class StringUtils {

protected StringUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Logger instance
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/TimeDurationUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
*
*/
public abstract class TimeDurationUtils {

protected TimeDurationUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* Compute the time duration of the given date from current time.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sangupta/jerry/util/UriUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
*
*/
public abstract class UriUtils {

protected UriUtils() throws InstantiationException {
throw new InstantiationException("Instances of this class are forbidden");
}

/**
* My own logger instance
Expand Down
Loading

0 comments on commit 81df6ca

Please sign in to comment.