diff options
author | Joey Grover <joeygrover@gmail.com> | 2019-10-01 11:57:40 -0400 |
---|---|---|
committer | Joey Grover <joeygrover@gmail.com> | 2019-10-01 11:57:40 -0400 |
commit | ade0b9cd8fda5c7494872f3093f193cb95accafe (patch) | |
tree | 2fab01dcdd9e2d48ed3bd83f6026895357931f26 | |
parent | bff9184e2d57a351a66ac1f715b055d279474eef (diff) | |
download | sdl_android-ade0b9cd8fda5c7494872f3093f193cb95accafe.tar.gz |
Remove Android codes from FileUtl; added javadoc
-rw-r--r-- | base/src/main/java/com/smartdevicelink/util/FileUtls.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/base/src/main/java/com/smartdevicelink/util/FileUtls.java b/base/src/main/java/com/smartdevicelink/util/FileUtls.java index 17806a8d2..762227f21 100644 --- a/base/src/main/java/com/smartdevicelink/util/FileUtls.java +++ b/base/src/main/java/com/smartdevicelink/util/FileUtls.java @@ -31,9 +31,8 @@ */ package com.smartdevicelink.util; -import android.os.Build; +import android.annotation.SuppressLint; import android.support.annotation.NonNull; -import android.support.annotation.RequiresApi; import java.io.ByteArrayOutputStream; import java.io.File; @@ -46,13 +45,22 @@ import java.nio.file.Files; public class FileUtls { - - @RequiresApi(api = Build.VERSION_CODES.O) + /** + * When using on Android, this method should only be used for Android Oreo and newer + * @param file the path to the file + * @return a byte array representation of the file if one exists + */ public static byte[] getFileData(String file){ return getFileData(file,null); } - @RequiresApi(api = Build.VERSION_CODES.O) + /** + * When using on Android, this method should only be used for Android Oreo and newer + * @param filePath the path to the file + * @param fileName the name of the file + * @return a byte array representation of the file if one exists + */ + @SuppressLint("NewApi") public static byte[] getFileData(String filePath, String fileName){ if(filePath != null && filePath.length() > 0) { File file; |