Skip to content

Commit

Permalink
refactor: apply formatting suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Jan 30, 2025
1 parent 41566e0 commit d86ae0f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 19 deletions.
42 changes: 28 additions & 14 deletions framework/src/org/apache/cordova/CordovaResourceApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,35 @@ Licensed to the Apache Software Foundation (ASF) under one
/**
* What this class provides:
*
* <p>1. Helpers for reading & writing to URLs.
* - E.g. handles assets, resources, content providers, files, data URIs, http[s]
* - E.g. Can be used to query for mime-type & content length.</p>
* <ol>
* <li>
* Helpers for reading & writing to URLs.
* <ul>
* <li>E.g. handles assets, resources, content providers, files, data URIs, http[s]</li>
* <li>E.g. Can be used to query for mime-type & content length.</p></li>
* </ul>
* </li>
* <li>
* To allow plugins to redirect URLs (via remapUrl).
* <ul>
* <li>
* All plugins should call remapUrl() on URLs they receive from JS *before* passing the URL onto other utility functions in this class.
* </li>
* <li>For an example usage of this, refer to the org.apache.cordova.file plugin.</li>
* </ul>
* </li>
* </ol>
*
* <p>2. To allow plugins to redirect URLs (via remapUrl).
* - All plugins should call remapUrl() on URLs they receive from JS *before*
* passing the URL onto other utility functions in this class.
* - For an example usage of this, refer to the org.apache.cordova.file plugin.</p>
*
* <p>Future Work:
* - Consider using a Cursor to query content URLs for their size (like the file plugin does).
* - Allow plugins to remapUri to "cdv-plugin://plugin-name/foo", which CordovaResourceApi
* would then delegate to pluginManager.getPlugin(plugin-name).openForRead(url)
* - Currently, plugins *can* do this by remapping to a data: URL, but it's inefficient
* for large payloads.</p>
* <p>Future Work:</p>
* <ul>
* <li>Consider using a Cursor to query content URLs for their size (like the file plugin does).</li>
* <li>
* Allow plugins to remapUri to "cdv-plugin://plugin-name/foo", which CordovaResourceApi would then delegate to pluginManager.getPlugin(plugin-name).openForRead(url)
* <ul>
* <li>Currently, plugins *can* do this by remapping to a data: URL, but it's inefficient for large payloads.</li>
* </ul>
* </li>
* </ul>
*/
public class CordovaResourceApi {
@SuppressWarnings("unused")
Expand Down
12 changes: 7 additions & 5 deletions framework/src/org/apache/cordova/engine/SystemWebViewClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,13 @@ public AuthenticationToken removeAuthenticationToken(String host, String realm)
/**
* Gets the authentication token.
*
* <p>In order it tries:
* 1- host + realm
* 2- host
* 3- realm
* 4- no host, no realm</p>
* <p>In order it tries:</p>
* <ol>
* <li>host + realm</li>
* <li>host</li>
* <li>realm</li>
* <li>no host, no realm</li>
* </ol>
*
* @param host
* @param realm
Expand Down

0 comments on commit d86ae0f

Please sign in to comment.