Class UtilsKt

  • All Implemented Interfaces:

    
    public final class UtilsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final static <Error class: unknown class> PATH_STRING_COMPARATOR
      private final static <Error class: unknown class> VCS_DIRECTORIES
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final <Error class: unknown class> getPATH_STRING_COMPARATOR() A comparator that sorts parent paths before child paths.
      final <Error class: unknown class> getVCS_DIRECTORIES() A set of directories used by version control systems to store metadata.
      final static ByteArray calculateHash(File file, MessageDigest digest) Calculate the digest on the data from the given file.
      final static ByteArray calculateHash(String string, MessageDigest digest) Calculate the digest on the data from the given string.
      final static ByteArray calculateHash(InputStream inputStream, MessageDigest digest) Calculate the digest on the data from the given inputStream.
      final static <T extends Enum<T>> EnumSet<T> enumSetOf(T elems) A Kotlin-style convenience function to replace EnumSet.of() and EnumSet.noneOf().
      final static List<String> getAllAncestorDirectories(String file) Return recursively all ancestor directories of the given absolute file, ordered along the path from the parent of file to the root.
      final static File getCommonParentFile(Collection<File> files) Return the longest parent file that all files have in common, or a File with an empty path if they have no common parent file.
      final static <Error class: unknown class> joinNonBlank(String strings, String separator) Return the concatenated strings separated by separator whereas blank strings are omitted.
      final static <R extends Any> R temporaryProperties(Pair<String, String> properties, Function0<R> block) Temporarily set the specified system properties while executing block.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getPATH_STRING_COMPARATOR

         final <Error class: unknown class> getPATH_STRING_COMPARATOR()

        A comparator that sorts parent paths before child paths.

      • getVCS_DIRECTORIES

         final <Error class: unknown class> getVCS_DIRECTORIES()

        A set of directories used by version control systems to store metadata. The list covers also version control systems not supported by ORT, because such directories should never be considered.

      • enumSetOf

         final static <T extends Enum<T>> EnumSet<T> enumSetOf(T elems)

        A Kotlin-style convenience function to replace EnumSet.of() and EnumSet.noneOf().

      • getAllAncestorDirectories

         final static List<String> getAllAncestorDirectories(String file)

        Return recursively all ancestor directories of the given absolute file, ordered along the path from the parent of file to the root.

      • getCommonParentFile

         final static File getCommonParentFile(Collection<File> files)

        Return the longest parent file that all files have in common, or a File with an empty path if they have no common parent file.

      • joinNonBlank

         final static <Error class: unknown class> joinNonBlank(String strings, String separator)

        Return the concatenated strings separated by separator whereas blank strings are omitted.

      • temporaryProperties

         final static <R extends Any> R temporaryProperties(Pair<String, String> properties, Function0<R> block)

        Temporarily set the specified system properties while executing block. Afterwards, previously set properties have their original values restored and previously unset properties are cleared.