Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ public Object prepare(Context context) throws PayloadNotFoundException {
}

private File getFile(Context context) throws FileNotFoundException {
File file = new File(data);
// check if data is an absolute path or a local app path and check if file exists:
File file = data.contains(File.separator) ? new File(data) : context.getFileStreamPath(data);

if (!file.exists()) {

// check if it's a local app file:
file = context.getFileStreamPath(data);
if (!file.exists()) {
throw new FileNotFoundException(String.format("File '%s' does not exist", data));
}
throw new FileNotFoundException(String.format("File '%s' does not exist", data));
}

return file;
Expand Down