Class TransferFileUtil

java.lang.Object
com.amilesend.client.connection.file.TransferFileUtil

public final class TransferFileUtil extends Object
Shared utility class used by transfer logic.
  • Method Details

    • fetchMimeTypeFromFile

      public static String fetchMimeTypeFromFile(@NonNull @NonNull Path filePath) throws IOException
      Fetches the mime type for the given filePath. This is used to specify the content-type for requests and replies.
      Parameters:
      filePath - the file
      Returns:
      the string formatted mime type
      Throws:
      IOException - if an error occurred while reading the file
    • fetchMimeTypeFromFile

      public static String fetchMimeTypeFromFile(@NonNull @NonNull File file) throws IOException
      Fetches the mime type for the given file. This is used to specify the content-type for requests and replies.
      Parameters:
      file - the file
      Returns:
      the string formatted mime type
      Throws:
      IOException - if an error occurred while reading the file