|
YAACC - UPNP Client and Server
|
Decides which shared text may become a playable URI. More...

Static Public Member Functions | |
| static boolean | isAllowed (String text) |
| static String | extractUrl (String text) |
| static String | hostOf (String url) |
| The host of an http or https link as the picker shows it, in lower case, or null if the link has no usable host. | |
Static Public Attributes | |
| static final int | MAX_TEXT_LENGTH = 2048 |
| Longer texts are dropped, not truncated. | |
Decides which shared text may become a playable URI.
Plain Java so it can be unit tested on the JVM.
The text comes from another app and is untrusted. With the proxy option on, a file:// or bare-path URI would be served to the whole LAN through the local proxy, so only http and https links are accepted. Apps share a link inside a text ("Look at this https://...") as often as alone, so the first link is picked out of the text: it starts with http:// or https:// (compared as ASCII, no locale or Unicode case folding) at the start of the text or after white space or an opening bracket or quote, it ends at the first white space or control character, trailing punctuation is not part of it, and it has a host. Nothing after the link is used.
|
static |
| text | the shared text, may be null |
MAX_TEXT_LENGTH or has no link with a host Referenced by de.yaacc.browser.ShareIntentHandler.handle(), and de.yaacc.browser.ShareUriPolicy.isAllowed().


|
static |
The host of an http or https link as the picker shows it, in lower case, or null if the link has no usable host.
A user name in front of it (trusted.com@evil.example) is not the host.
| url | a link such as extractUrl(String) returns, may be null |
Referenced by de.yaacc.browser.ShareUriPolicy.extractUrl().

|
static |
| text | the shared text, may be null |
extractUrl(String) 