Skip to content

Commit

Permalink
Merge pull request #22 from Qeepsake/fixed_file_path_issue
Browse files Browse the repository at this point in the history
fix(timestamp): android failing to read timestamp of file:// paths
  • Loading branch information
Luke Brandon Farrell authored Feb 10, 2022
2 parents 6d336a9 + 4097860 commit 219d0cf
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.facebook.react.module.annotations.ReactModule;

import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -143,13 +142,7 @@ public void getTimestamp(String uri, String mediaType, Promise promise) {

// Handle getting mime type for images
if (mediaType.equalsIgnoreCase("image")) {
InputStream inputStream = null;

if(URLUtil.isContentUrl(uri)) {
inputStream = mContext.getContentResolver().openInputStream(fileUri);
} else if(URLUtil.isFileUrl(uri)) {
inputStream = new FileInputStream(uri);
}
InputStream inputStream = mContext.getContentResolver().openInputStream(fileUri);

if(inputStream != null) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
Expand Down

0 comments on commit 219d0cf

Please sign in to comment.