Class ApacheCommons

java.lang.Object
de.iip_ecosphere.platform.support.commons.Commons
de.oktoflow.platform.support.commons.apache.ApacheCommons

public class ApacheCommons extends de.iip_ecosphere.platform.support.commons.Commons
Implements the Commons interface by Apache.
Author:
Holger Eichelberger, SSE
  • Field Details

    • SHORT_STRING_STYLE

      static final org.apache.commons.lang3.builder.ToStringStyle SHORT_STRING_STYLE
      Short prefix style with limited string output.
  • Constructor Details

    • ApacheCommons

      public ApacheCommons()
  • Method Details

    • reverse

      public void reverse(Object[] array)
      Specified by:
      reverse in class de.iip_ecosphere.platform.support.commons.Commons
    • copyFields

      public void copyFields(Object source, Object target) throws ExecutionException
      Specified by:
      copyFields in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      ExecutionException
    • escapeJava

      public final String escapeJava(String input)
      Specified by:
      escapeJava in class de.iip_ecosphere.platform.support.commons.Commons
    • unescapeJava

      public final String unescapeJava(String input)
      Specified by:
      unescapeJava in class de.iip_ecosphere.platform.support.commons.Commons
    • escapeJson

      public String escapeJson(String input)
      Specified by:
      escapeJson in class de.iip_ecosphere.platform.support.commons.Commons
    • unescapeJson

      public String unescapeJson(String input)
      Specified by:
      unescapeJson in class de.iip_ecosphere.platform.support.commons.Commons
    • defaultIfBlank

      public <T extends CharSequence> T defaultIfBlank(T str, T defaultStr)
      Specified by:
      defaultIfBlank in class de.iip_ecosphere.platform.support.commons.Commons
    • defaultIfEmpty

      public <T extends CharSequence> T defaultIfEmpty(T str, T defaultStr)
      Specified by:
      defaultIfEmpty in class de.iip_ecosphere.platform.support.commons.Commons
    • isBlank

      public boolean isBlank(CharSequence cs)
      Specified by:
      isBlank in class de.iip_ecosphere.platform.support.commons.Commons
    • isNotBlank

      public boolean isNotBlank(CharSequence cs)
      Specified by:
      isNotBlank in class de.iip_ecosphere.platform.support.commons.Commons
    • replaceOnce

      public String replaceOnce(String text, String searchString, String replacement)
      Specified by:
      replaceOnce in class de.iip_ecosphere.platform.support.commons.Commons
    • isEmpty

      public boolean isEmpty(CharSequence cs)
      Specified by:
      isEmpty in class de.iip_ecosphere.platform.support.commons.Commons
    • toString

      public String toString(Object obj)
      Specified by:
      toString in class de.iip_ecosphere.platform.support.commons.Commons
    • toStringShortStyle

      public String toStringShortStyle(Object obj)
      Specified by:
      toStringShortStyle in class de.iip_ecosphere.platform.support.commons.Commons
    • toStringMultiLineStyle

      public String toStringMultiLineStyle(Object obj)
      Specified by:
      toStringMultiLineStyle in class de.iip_ecosphere.platform.support.commons.Commons
    • removeStart

      public String removeStart(String str, String remove)
      Specified by:
      removeStart in class de.iip_ecosphere.platform.support.commons.Commons
    • removeEnd

      public String removeEnd(String str, String remove)
      Specified by:
      removeEnd in class de.iip_ecosphere.platform.support.commons.Commons
    • getUserHome

      public String getUserHome()
      Overrides:
      getUserHome in class de.iip_ecosphere.platform.support.commons.Commons
    • isWindows

      public boolean isWindows()
      Specified by:
      isWindows in class de.iip_ecosphere.platform.support.commons.Commons
    • isLinux

      public boolean isLinux()
      Specified by:
      isLinux in class de.iip_ecosphere.platform.support.commons.Commons
    • isUnix

      public boolean isUnix()
      Specified by:
      isUnix in class de.iip_ecosphere.platform.support.commons.Commons
    • isMac

      public boolean isMac()
      Specified by:
      isMac in class de.iip_ecosphere.platform.support.commons.Commons
    • isJava1_8

      public boolean isJava1_8()
      Specified by:
      isJava1_8 in class de.iip_ecosphere.platform.support.commons.Commons
    • isAtLeastJava9

      public boolean isAtLeastJava9()
      Specified by:
      isAtLeastJava9 in class de.iip_ecosphere.platform.support.commons.Commons
    • getJavaHome

      public File getJavaHome()
      Overrides:
      getJavaHome in class de.iip_ecosphere.platform.support.commons.Commons
    • getJavaSpecificationVersion

      public String getJavaSpecificationVersion()
      Overrides:
      getJavaSpecificationVersion in class de.iip_ecosphere.platform.support.commons.Commons
    • isIpV4Addess

      public boolean isIpV4Addess(String address)
      Specified by:
      isIpV4Addess in class de.iip_ecosphere.platform.support.commons.Commons
    • toString

      public String toString(InputStream in, Charset charset) throws IOException
      Specified by:
      toString in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • readLines

      public List<String> readLines(InputStream in, Charset charset) throws IOException
      Specified by:
      readLines in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • toByteArray

      public byte[] toByteArray(InputStream inputStream) throws IOException
      Specified by:
      toByteArray in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • write

      public void write(byte[] data, OutputStream outputStream) throws IOException
      Specified by:
      write in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • deleteQuietly

      public boolean deleteQuietly(File file)
      Specified by:
      deleteQuietly in class de.iip_ecosphere.platform.support.commons.Commons
    • forceDelete

      public void forceDelete(File file) throws IOException
      Specified by:
      forceDelete in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • deleteOnExit

      public void deleteOnExit(File file)
      Specified by:
      deleteOnExit in class de.iip_ecosphere.platform.support.commons.Commons
    • getTempDirectoryPath

      public String getTempDirectoryPath()
      Overrides:
      getTempDirectoryPath in class de.iip_ecosphere.platform.support.commons.Commons
    • getTempDirectory

      public File getTempDirectory()
      Overrides:
      getTempDirectory in class de.iip_ecosphere.platform.support.commons.Commons
    • getUserDirectory

      public File getUserDirectory()
      Overrides:
      getUserDirectory in class de.iip_ecosphere.platform.support.commons.Commons
    • getUserDirectoryPath

      public String getUserDirectoryPath()
      Overrides:
      getUserDirectoryPath in class de.iip_ecosphere.platform.support.commons.Commons
    • fileToBase64

      public String fileToBase64(File file) throws IOException
      Specified by:
      fileToBase64 in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • base64ToFile

      public void base64ToFile(String string, File file) throws IOException
      Specified by:
      base64ToFile in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • findFile

      public File findFile(File folder, String name)
      Specified by:
      findFile in class de.iip_ecosphere.platform.support.commons.Commons
    • write

      public void write(File file, CharSequence data, Charset charset) throws IOException
      Specified by:
      write in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • readFileToString

      public String readFileToString(File file) throws IOException
      Specified by:
      readFileToString in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • readFileToString

      public String readFileToString(File file, Charset charset) throws IOException
      Specified by:
      readFileToString in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • cleanDirectory

      public void cleanDirectory(File directory) throws IOException
      Specified by:
      cleanDirectory in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • deleteDirectory

      public void deleteDirectory(File directory) throws IOException
      Specified by:
      deleteDirectory in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • copyDirectory

      public void copyDirectory(File srcDir, File destDir, FileFilter filter) throws IOException
      Specified by:
      copyDirectory in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • copyDirectory

      public void copyDirectory(File srcDir, File destDir, FileFilter filter, boolean preserveFileDate) throws IOException
      Specified by:
      copyDirectory in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • copyDirectory

      public void copyDirectory(File srcDir, File destDir) throws IOException
      Specified by:
      copyDirectory in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • copyFile

      public void copyFile(File srcFile, File destFile) throws IOException
      Specified by:
      copyFile in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • writeStringToFile

      public void writeStringToFile(File file, String data) throws IOException
      Specified by:
      writeStringToFile in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • writeStringToFile

      public void writeStringToFile(File file, String data, Charset charset) throws IOException
      Specified by:
      writeStringToFile in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • readFileToByteArray

      public byte[] readFileToByteArray(File file) throws IOException
      Specified by:
      readFileToByteArray in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • writeByteArrayToFile

      public void writeByteArrayToFile(File file, byte[] data) throws IOException
      Specified by:
      writeByteArrayToFile in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • writeByteArrayToFile

      public void writeByteArrayToFile(File file, byte[] data, boolean append) throws IOException
      Specified by:
      writeByteArrayToFile in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • copyInputStreamToFile

      public void copyInputStreamToFile(InputStream source, File destination) throws IOException
      Specified by:
      copyInputStreamToFile in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • contentEquals

      public boolean contentEquals(File file1, File file2) throws IOException
      Specified by:
      contentEquals in class de.iip_ecosphere.platform.support.commons.Commons
      Throws:
      IOException
    • registerDateConverters

      public void registerDateConverters()
      Specified by:
      registerDateConverters in class de.iip_ecosphere.platform.support.commons.Commons
    • createTailer

      public de.iip_ecosphere.platform.support.commons.Tailer createTailer(File file, de.iip_ecosphere.platform.support.commons.TailerListener listener, Duration delayDuration, boolean fromEnd)
      Specified by:
      createTailer in class de.iip_ecosphere.platform.support.commons.Commons
    • createFileAlterationObserver

      public de.iip_ecosphere.platform.support.commons.FileAlterationObserver createFileAlterationObserver(String directory, FileFilter fileFilter)
      Specified by:
      createFileAlterationObserver in class de.iip_ecosphere.platform.support.commons.Commons
    • createFileAlterationMonitor

      public de.iip_ecosphere.platform.support.commons.FileAlterationMonitor createFileAlterationMonitor(long interval, de.iip_ecosphere.platform.support.commons.FileAlterationObserver... observers)
      Specified by:
      createFileAlterationMonitor in class de.iip_ecosphere.platform.support.commons.Commons