MCPcopy Create free account
hub / github.com/XCSoar/XCSoar / matchPath

Method matchPath

android/src/DownloadUtil.java:86–101  ·  view source on GitHub ↗

Check if this local URI is within the XCSoarData directory, and returns the absolute path. Returns null on mismatch.

(Uri uri)

Source from the content-addressed store, hash-verified

84 * returns the absolute path. Returns null on mismatch.
85 */
86 String matchPath(Uri uri) {
87 /* XXX this check is a kludge to identify downloads started
88 by XCSoar */
89
90 if (!uri.getScheme().equals("file"))
91 return null;
92
93 final String path = uri.getPath();
94 final File file = new File(path);
95 final File parent = file.getParentFile();
96 if (parent == null || !parent.equals(downloadDirectory))
97 /* not in the download directory - not for us */
98 return null;
99
100 return path;
101 }
102
103 String matchPath(String uri) {
104 return uri != null

Callers 2

enumerateMethod · 0.95
checkCompleteMethod · 0.95

Calls 1

equalsMethod · 0.80

Tested by

no test coverage detected