Class ApacheCommonsUtils

java.lang.Object
eu.europa.esig.dss.utils.apache.impl.ApacheCommonsUtils
All Implemented Interfaces:
eu.europa.esig.dss.utils.IUtils

public class ApacheCommonsUtils extends Object implements eu.europa.esig.dss.utils.IUtils
Apache Commons implementation of Utils
  • Constructor Details

    • ApacheCommonsUtils

      public ApacheCommonsUtils()
      Default constructor
  • Method Details

    • isStringEmpty

      public boolean isStringEmpty(String text)
      Specified by:
      isStringEmpty in interface eu.europa.esig.dss.utils.IUtils
    • isStringNotEmpty

      public boolean isStringNotEmpty(String text)
      Specified by:
      isStringNotEmpty in interface eu.europa.esig.dss.utils.IUtils
    • isStringBlank

      public boolean isStringBlank(String text)
      Specified by:
      isStringBlank in interface eu.europa.esig.dss.utils.IUtils
    • isStringNotBlank

      public boolean isStringNotBlank(String text)
      Specified by:
      isStringNotBlank in interface eu.europa.esig.dss.utils.IUtils
    • areStringsEqual

      public boolean areStringsEqual(String text1, String text2)
      Specified by:
      areStringsEqual in interface eu.europa.esig.dss.utils.IUtils
    • areStringsEqualIgnoreCase

      public boolean areStringsEqualIgnoreCase(String text1, String text2)
      Specified by:
      areStringsEqualIgnoreCase in interface eu.europa.esig.dss.utils.IUtils
    • isStringDigits

      public boolean isStringDigits(String text)
      Specified by:
      isStringDigits in interface eu.europa.esig.dss.utils.IUtils
    • trim

      public String trim(String text)
      Specified by:
      trim in interface eu.europa.esig.dss.utils.IUtils
    • joinStrings

      public String joinStrings(Collection<String> strings, String separator)
      Specified by:
      joinStrings in interface eu.europa.esig.dss.utils.IUtils
    • concat

      public byte[] concat(byte[]... byteArrays)
      Specified by:
      concat in interface eu.europa.esig.dss.utils.IUtils
    • substringAfter

      public String substringAfter(String text, String after)
      Specified by:
      substringAfter in interface eu.europa.esig.dss.utils.IUtils
    • endsWithIgnoreCase

      public boolean endsWithIgnoreCase(String text, String expected)
      Specified by:
      endsWithIgnoreCase in interface eu.europa.esig.dss.utils.IUtils
    • getFileNameExtension

      public String getFileNameExtension(String filename)
      Specified by:
      getFileNameExtension in interface eu.europa.esig.dss.utils.IUtils
    • lowerCase

      public String lowerCase(String text)
      Specified by:
      lowerCase in interface eu.europa.esig.dss.utils.IUtils
    • upperCase

      public String upperCase(String text)
      Specified by:
      upperCase in interface eu.europa.esig.dss.utils.IUtils
    • isArrayEmpty

      public boolean isArrayEmpty(Object[] array)
      Specified by:
      isArrayEmpty in interface eu.europa.esig.dss.utils.IUtils
    • isArrayNotEmpty

      public boolean isArrayNotEmpty(Object[] array)
      Specified by:
      isArrayNotEmpty in interface eu.europa.esig.dss.utils.IUtils
    • arraySize

      public int arraySize(Object[] array)
      Specified by:
      arraySize in interface eu.europa.esig.dss.utils.IUtils
    • isArrayEmpty

      public boolean isArrayEmpty(byte[] array)
      Specified by:
      isArrayEmpty in interface eu.europa.esig.dss.utils.IUtils
    • isArrayNotEmpty

      public boolean isArrayNotEmpty(byte[] array)
      Specified by:
      isArrayNotEmpty in interface eu.europa.esig.dss.utils.IUtils
    • arraySize

      public int arraySize(byte[] array)
      Specified by:
      arraySize in interface eu.europa.esig.dss.utils.IUtils
    • isArrayEmpty

      public boolean isArrayEmpty(char[] array)
      Specified by:
      isArrayEmpty in interface eu.europa.esig.dss.utils.IUtils
    • isArrayNotEmpty

      public boolean isArrayNotEmpty(char[] array)
      Specified by:
      isArrayNotEmpty in interface eu.europa.esig.dss.utils.IUtils
    • arraySize

      public int arraySize(char[] array)
      Specified by:
      arraySize in interface eu.europa.esig.dss.utils.IUtils
    • subarray

      public byte[] subarray(byte[] array, int start, int length)
      Specified by:
      subarray in interface eu.europa.esig.dss.utils.IUtils
    • isTrue

      public boolean isTrue(Boolean bool)
      Specified by:
      isTrue in interface eu.europa.esig.dss.utils.IUtils
    • isCollectionEmpty

      public boolean isCollectionEmpty(Collection collection)
      Specified by:
      isCollectionEmpty in interface eu.europa.esig.dss.utils.IUtils
    • isCollectionNotEmpty

      public boolean isCollectionNotEmpty(Collection collection)
      Specified by:
      isCollectionNotEmpty in interface eu.europa.esig.dss.utils.IUtils
    • isMapEmpty

      public boolean isMapEmpty(Map<?,?> map)
      Specified by:
      isMapEmpty in interface eu.europa.esig.dss.utils.IUtils
    • isMapNotEmpty

      public boolean isMapNotEmpty(Map<?,?> map)
      Specified by:
      isMapNotEmpty in interface eu.europa.esig.dss.utils.IUtils
    • collectionSize

      public int collectionSize(Collection collection)
      Specified by:
      collectionSize in interface eu.europa.esig.dss.utils.IUtils
    • isHexEncoded

      public boolean isHexEncoded(String hexString)
      Specified by:
      isHexEncoded in interface eu.europa.esig.dss.utils.IUtils
    • toHex

      public String toHex(byte[] bytes)
      Specified by:
      toHex in interface eu.europa.esig.dss.utils.IUtils
    • fromHex

      public byte[] fromHex(String hex)
      Specified by:
      fromHex in interface eu.europa.esig.dss.utils.IUtils
    • isBase64Encoded

      public boolean isBase64Encoded(String base64String)
      Specified by:
      isBase64Encoded in interface eu.europa.esig.dss.utils.IUtils
    • toBase64

      public String toBase64(byte[] bytes)
      Specified by:
      toBase64 in interface eu.europa.esig.dss.utils.IUtils
    • fromBase64

      public byte[] fromBase64(String base64)
      Specified by:
      fromBase64 in interface eu.europa.esig.dss.utils.IUtils
    • toByteArray

      public byte[] toByteArray(InputStream is) throws IOException
      Specified by:
      toByteArray in interface eu.europa.esig.dss.utils.IUtils
      Throws:
      IOException
    • closeQuietly

      public void closeQuietly(Closeable closeable)
      Specified by:
      closeQuietly in interface eu.europa.esig.dss.utils.IUtils
    • copy

      public void copy(InputStream is, OutputStream os) throws IOException
      Specified by:
      copy in interface eu.europa.esig.dss.utils.IUtils
      Throws:
      IOException
    • write

      public void write(byte[] content, OutputStream os) throws IOException
      Specified by:
      write in interface eu.europa.esig.dss.utils.IUtils
      Throws:
      IOException
    • nullOutputStream

      public OutputStream nullOutputStream()
      Specified by:
      nullOutputStream in interface eu.europa.esig.dss.utils.IUtils
    • getInputStreamSize

      public long getInputStreamSize(InputStream is) throws IOException
      Specified by:
      getInputStreamSize in interface eu.europa.esig.dss.utils.IUtils
      Throws:
      IOException
    • compareInputStreams

      public boolean compareInputStreams(InputStream stream1, InputStream stream2) throws IOException
      Specified by:
      compareInputStreams in interface eu.europa.esig.dss.utils.IUtils
      Throws:
      IOException
    • startsWith

      public boolean startsWith(byte[] byteArray, byte[] prefixArray)
      Specified by:
      startsWith in interface eu.europa.esig.dss.utils.IUtils
    • startsWith

      public boolean startsWith(InputStream inputStream, byte[] prefixArray) throws IOException
      Specified by:
      startsWith in interface eu.europa.esig.dss.utils.IUtils
      Throws:
      IOException
    • cleanDirectory

      public void cleanDirectory(File directory) throws IOException
      Specified by:
      cleanDirectory in interface eu.europa.esig.dss.utils.IUtils
      Throws:
      IOException
    • listFiles

      public Collection<File> listFiles(File folder, String[] extensions, boolean recursive)
      Specified by:
      listFiles in interface eu.europa.esig.dss.utils.IUtils
    • reverseList

      public <T> List<T> reverseList(List<T> list)
      Specified by:
      reverseList in interface eu.europa.esig.dss.utils.IUtils
    • containsAny

      public <T> boolean containsAny(Collection<T> superCollection, Collection<T> subCollection)
      Specified by:
      containsAny in interface eu.europa.esig.dss.utils.IUtils