java.lang.Object
io.github.astrapi69.file.FileExtensions

public final class FileExtensions extends Object
Utility class for the use with File object
  • Method Details

    • download

      public static byte[] download(URI uri) throws IOException
      Downloads Data from the given URI.
      Parameters:
      uri - The URI from where to download.
      Returns:
      Returns a byte array or null.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getAbsolutPathWithoutFilename

      public static String getAbsolutPathWithoutFilename(File file)
      Gets the absolut path without the filename.
      Parameters:
      file - the file.
      Returns:
      's the absolut path without filename.
    • getCurrentAbsolutPathWithoutDotAndSlash

      public static String getCurrentAbsolutPathWithoutDotAndSlash()
      Gets the current absolut path without the dot and slash.
      Returns:
      's the current absolut path without the dot and slash.
    • getContentType

      public static String getContentType(File file) throws IOException
      Gets the content type from the given file object
      Parameters:
      file - the file
      Returns:
      's the content type from the given file object
      Throws:
      IOException - Signals that an I/O exception has occurred
    • isOpen

      public static boolean isOpen(File file) throws IOException
      Not yet implemented. Checks if the given file is open.
      Parameters:
      file - The file to check.
      Returns:
      Return true if the file is open otherwise false.
      Throws:
      IOException - Signals that an I/O exception has occurred.