Class FileUtilities

java.lang.Object
de.gurkenlabs.litiengine.util.io.FileUtilities

public final class FileUtilities
extends java.lang.Object
  • Method Summary

    Modifier and TypeMethodDescription
    static java.lang.Stringcombine​(java.lang.String basePath, java.lang.String... paths)
    This method combines the specified basepath with the parts provided as arguments.
    static booleandeleteDir​(java.io.File dir) 
    static java.util.List<java.lang.String>findFiles​(java.util.List<java.lang.String> fileNames, java.nio.file.Path dir, java.lang.String... files) 
    static java.util.List<java.lang.String>findFilesByExtension​(java.util.List<java.lang.String> fileNames, java.nio.file.Path dir, java.lang.String extension) 
    static java.lang.StringgetExtension​(java.io.File file) 
    static java.lang.StringgetExtension​(java.lang.String path) 
    static java.lang.StringgetFileName​(java.lang.String path) 
    static java.lang.StringgetFileName​(java.lang.String path, boolean extension) 
    static java.lang.StringgetFileName​(java.net.URL path) 
    static java.lang.StringgetParentDirPath​(java.lang.String uri) 
    static java.lang.StringgetParentDirPath​(java.net.URI uri) 

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • deleteDir

      public static boolean deleteDir​(java.io.File dir)
    • findFilesByExtension

      public static java.util.List<java.lang.String> findFilesByExtension​(java.util.List<java.lang.String> fileNames, java.nio.file.Path dir, java.lang.String extension)
    • findFiles

      public static java.util.List<java.lang.String> findFiles​(java.util.List<java.lang.String> fileNames, java.nio.file.Path dir, java.lang.String... files)
    • getExtension

      public static java.lang.String getExtension​(java.io.File file)
    • getExtension

      public static java.lang.String getExtension​(java.lang.String path)
    • getFileName

      public static java.lang.String getFileName​(java.net.URL path)
    • getFileName

      public static java.lang.String getFileName​(java.lang.String path)
    • getFileName

      public static java.lang.String getFileName​(java.lang.String path, boolean extension)
    • getParentDirPath

      public static java.lang.String getParentDirPath​(java.lang.String uri)
    • getParentDirPath

      public static java.lang.String getParentDirPath​(java.net.URI uri)
    • combine

      public static java.lang.String combine​(java.lang.String basePath, java.lang.String... paths)
      This method combines the specified basepath with the parts provided as arguments. The output will use the path separator of the current system;
      Parameters:
      basePath - The base path for the combined path.
      paths - The parts of the path to be constructed.
      Returns:
      The combined path.