[
https://issues.apache.org/jira/browse/CB-6428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14364347#comment-14364347
]
Jacob G edited comment on CB-6428 at 3/17/15 1:08 AM:
------------------------------------------------------
So I think the fix for the bug referenced in the last two comments is that in
FileSystem.java, the following method:
{code:java}
public JSONObject makeEntryForNativeUri(Uri nativeUri) {
LocalFilesystemURL inputUrl = toLocalUri(nativeUri);
return makeEntryForURL(inputUrl, nativeUri);
}
{code}
should be changed to:
{code:java}
public JSONObject makeEntryForNativeUri(Uri nativeUri) {
LocalFilesystemURL inputUrl = toLocalUri(nativeUri);
return inputUrl != null ? makeEntryForURL(inputUrl, nativeUri) : null;
}
{code}
With that change, I can successfully download the file using FileTransfer,
which depends on the File plugin.
[~agrieve]: Do you agree with that fix? Is that something you can commit to
this repository? Thanks.
was (Author: jacobgu):
So I think the fix for the bug referenced in the last two comments is that in
FileSystem.java, the following method:
public JSONObject makeEntryForNativeUri(Uri nativeUri) {
LocalFilesystemURL inputUrl = toLocalUri(nativeUri);
return makeEntryForURL(inputUrl, nativeUri);
}
should be changed to:
public JSONObject makeEntryForNativeUri(Uri nativeUri) {
LocalFilesystemURL inputUrl = toLocalUri(nativeUri);
return inputUrl != null ? makeEntryForURL(inputUrl, nativeUri) : null;
}
With that change, I can successfully download the file using FileTransfer,
which depends on the File plugin.
[~agrieve]: Do you agree with that fix? Is that something you can commit to
this repository? Thanks.
> Unable to read android_asset directory through File API
> -------------------------------------------------------
>
> Key: CB-6428
> URL: https://issues.apache.org/jira/browse/CB-6428
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin File
> Affects Versions: 3.3.0
> Environment: Android 4.4.2 / Samsung Galaxy S4
> Reporter: Matt Grande
> Assignee: Andrew Grieve
> Labels: android, file
>
> Attempting to read the 'android_asset' folder through the File API results in
> Error Code 5 (FileError.ENCODING_ERR). I've tried accessing via
> resolveLocalFileSystemURL, and by creating a directory reader and calling
> readEntries().
>
> window.resolveLocalFileSystemURL('file:///android_asset/www/my_asset_folder',
> success, fail);
> var sourceDir = new DirectoryEntry( { fullPath:
> 'file:///android_asset/www/my_asset_folder' } );
> var reader = sourceDir.createReader();
> reader.readEntries(success, fail);
> (I have also tried with the URLs being '/android_asset/www/my_asset_folder';
> same result)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]