-
Notifications
You must be signed in to change notification settings - Fork 120
Upgrade File Access to DocumentFile for Scoped Storage Compatibility #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
| assertTrue(instanceFolder.exists()); | ||
| FileOutputStream f = new FileOutputStream(new File(instanceFolder.getPath() + "/temp")); | ||
| f.write(new byte[] { 97, 98, 99 }); | ||
| File tempFile = new File(instanceFolder, "temp"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wbrunette what do you think, please. Although he converted the File object to a DocumentFile in line 1580
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct,
There are other ways to create a DocumentFile such as fromSingleUri
OutputStream outputStream = context.getContentResolver().openOutputStream(newFile.getUri());
if (outputStream != null) {
outputStream.write(content.getBytes());
outputStream.close();
}
|
|
||
| FileManifestDocument tableManifestEntries = | ||
| synchronizer.getAppLevelFileManifest(null, null, true); | ||
| synchronizer.getAppLevelFileManifest(String.valueOf(nullFiles), null, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you use this String.valueOf(nullFiles), please?
| new File(ODKFileUtils.getAssetsCsvInstanceFolder(getAppName(), tableId, rowIdFullCommon), | ||
| "sample.jpg")); | ||
| cvValues.put("col6", ODKFileUtils.asConfigRelativePath(getAppName(), configFile)); // configpath | ||
| File rowFile = new File(ODKFileUtils.getInstanceFolder(getAppName(), tableId, rowIdFullCommon), "sample.jpg"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you skipped this
| // on the server. | ||
|
|
||
| for (OdkTablesFileManifestEntry entry : manifestDocument.entries) { | ||
| File localFile = ODKFileUtils.asConfigFile(sc.getAppName(), entry.filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this?
No description provided.