Class TransferFileUtil
java.lang.Object
com.amilesend.client.connection.file.TransferFileUtil
Shared utility class used by transfer logic.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
fetchMimeTypeFromFile
(@NonNull File file) Fetches the mime type for the givenfile
.static String
fetchMimeTypeFromFile
(@NonNull Path filePath) Fetches the mime type for the givenfilePath
.
-
Method Details
-
fetchMimeTypeFromFile
Fetches the mime type for the givenfilePath
. 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
Fetches the mime type for the givenfile
. 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
-