Class XNioPathUtils


  • public final class XNioPathUtils
    extends Object
    Helper functions for Path instances.
    Since:
    8.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • deleteQuietly

        public static void deleteQuietly​(Path path)
        Deletes the file at the given path, ignoring any exceptions that may occur.
        Parameters:
        path - Path to delete.
      • getFileName

        public static String getFileName​(Path path)
        Gets the file name of the given path, or empty when the path does not have any path segments.
        Parameters:
        path - Path to process.
        Returns:
        The file name of the given path.
      • readFileToByteArray

        public static byte[] readFileToByteArray​(Path path)
                                          throws IOException
        Reads the contents of the file at the given path into a byte array.
        Parameters:
        path - Path to read.
        Returns:
        The contents of the file at the given path as a byte array.
        Throws:
        IOException