GlueGen: src/junit/com/jogamp/common/net/TestUri01.java Source File

GlueGen v2.6.0 GlueGen, Native Binding Generator for Java™ (public API).

TestUri01.java
Go to the documentation of this file.
1package com.jogamp.common.net;
2
3import java.io.File;
4import java.io.IOException;
5import java.net.URI;
6import java.net.URISyntaxException;
7
8import org.junit.Assert;
9import org.junit.Test;
10
11import com.jogamp.common.net.URIDumpUtil;
12import com.jogamp.common.util.IOUtil;
13import com.jogamp.junit.util.SingletonJunitCase;
14
15import org.junit.FixMethodOrder;
16import org.junit.runners.MethodSorters;
17
18@FixMethodOrder(MethodSorters.NAME_ASCENDING)
19public class TestUri01 extends SingletonJunitCase {
20
21 @Test
22 public void test00BasicCoding() throws IOException, URISyntaxException {
23 final String string = "Hallo Welt öä";
24 System.err.println("sp1 "+string);
25 final File file = new File(string);
26 System.err.println("file "+file);
27 System.err.println("file.path.dec "+file.getPath());
28 System.err.println("file.path.abs "+file.getAbsolutePath());
29 System.err.println("file.path.can "+file.getCanonicalPath());
30 final Uri uri0 = Uri.valueOf(file);
31 URIDumpUtil.showUri(uri0);
32 URIDumpUtil.showReencodedURIOfUri(uri0);
33
34 boolean ok = true;
35 {
36 final String s2 = IOUtil.slashify(file.getAbsolutePath(), true /* startWithSlash */, file.isDirectory() /* endWithSlash */);
37 System.err.println("uri2.slashify: "+s2);
38 final Uri uri1 = Uri.create(Uri.FILE_SCHEME, null, s2, null);
39 final boolean equalEncoded= uri0.getEncoded().equals(uri1.getEncoded());
40 final boolean equalPath = uri0.path.decode().equals(uri1.path.decode());
41 final boolean equalASCII= uri0.toASCIIString().equals(uri1.toASCIIString().get());
42 System.err.println("uri2.enc : "+uri1.getEncoded()+" - "+(equalEncoded?"OK":"ERROR"));
43 System.err.println("uri2.pathD : "+uri1.path.decode()+" - "+(equalPath?"OK":"ERROR"));
44 System.err.println("uri2.asciiE: "+uri1.toASCIIString()+" - "+(equalASCII?"OK":"ERROR"));
45 ok = equalEncoded && equalPath && equalASCII && ok;
46 }
47 {
48 final String s2 = "/"+string;
49 System.err.println("uri3.orig: "+s2);
50 final Uri uri1 = Uri.create(Uri.FILE_SCHEME, s2, null);
51 final String rString = "file:/Hallo%20Welt%20öä";
52 final String rPath = s2;
53 final String rASCII = "file:/Hallo%20Welt%20%C3%B6%C3%A4";
54 final boolean equalEncoded = rString.equals(uri1.toString());
55 final boolean equalPath = rPath.equals(uri1.path.decode());
56 final boolean equalASCII= rASCII.equals(uri1.toASCIIString().get());
57 System.err.println("uri3.enc : "+uri1.toString()+" - "+(equalEncoded?"OK":"ERROR"));
58 System.err.println("uri3.pathD : "+uri1.path.decode()+" - "+(equalPath?"OK":"ERROR"));
59 System.err.println("uri3.asciiE: "+uri1.toASCIIString()+" - "+(equalASCII?"OK":"ERROR"));
60 ok = equalEncoded && equalPath && equalASCII && ok;
61 }
62 {
63 final String s2 = "//lala.org/"+string;
64 System.err.println("uri4.orig: "+s2);
65 final Uri uri1 = Uri.create(Uri.HTTP_SCHEME, s2, null);
66 final String rString = "http://lala.org/Hallo%20Welt%20öä";
67 final String rPath = "/"+string;
68 final String rASCII = "http://lala.org/Hallo%20Welt%20%C3%B6%C3%A4";
69 final boolean equalString= rString.equals(uri1.toString());
70 final boolean equalPath = rPath.equals(uri1.path.decode());
71 final boolean equalASCII= rASCII.equals(uri1.toASCIIString().get());
72 System.err.println("uri4.enc : "+uri1.toString()+" - "+(equalString?"OK":"ERROR"));
73 System.err.println("uri4.pathD : "+uri1.path.decode()+" - "+(equalPath?"OK":"ERROR"));
74 System.err.println("uri4.asciiE: "+uri1.toASCIIString()+" - "+(equalASCII?"OK":"ERROR"));
75 ok = equalString && equalPath && equalASCII && ok;
76 }
77 Assert.assertTrue("One or more errors occured see stderr above", ok);
78 }
79
80 @Test
81 public void test02URIEscapeSpecialChars() throws IOException, URISyntaxException {
82 {
83 final String vanilla = "XXX ! # $ & ' ( ) * + , / : ; = ? @ [ ]";
84 final Uri.Encoded escaped = Uri.Encoded.cast("XXX%20!%20%23%20%24%20%26%20%27%20%28%20%29%20%2A%20%2B%20%2C%20/%20%3A%20%3B%20%3D%20%3F%20%40%20%5B%20%5D");
85 System.err.println("vanilla "+vanilla);
86 final Uri.Encoded esc1 = new Uri.Encoded(vanilla, Uri.PATH_LEGAL);
87 System.err.println("esc1 "+esc1);
88 Assert.assertEquals(escaped, esc1);
89
90 final String invEsc1 = esc1.decode();
91 System.err.println("inv(esc1) "+invEsc1);
92 Assert.assertEquals(vanilla, invEsc1);
93 }
94 {
95 final String vanilla = "/XXX R!# R$&'()*+,/:;=?z@y[x]";
96 final Uri.Encoded escaped = Uri.Encoded.cast("/XXX%20R!%23%20R%24%26%27%28%29%2A%2B%2C/%3A%3B%3D%3Fz%40y%5Bx%5D");
97 System.err.println("vanilla "+vanilla);
98 final Uri.Encoded esc1 = new Uri.Encoded(vanilla, Uri.PATH_LEGAL);
99 System.err.println("esc1 "+esc1);
100 Assert.assertEquals(escaped, esc1);
101
102 final String invEsc1 = esc1.decode();
103 System.err.println("inv(esc1) "+invEsc1);
104 Assert.assertEquals(vanilla, invEsc1);
105 }
106 {
107 // Bug 908: $ ^ ~ # [ ]
108 final String vanilla = "/XXX $ ^ ~ # [ ]";
109 showDump0x(vanilla);
110 }
111 {
112 // Windows invalid File characters: * ? " < > |
113 final String vanilla = "/XXX ! & ' ( ) + , / ; = @ [ ]";
114 showDump0x(vanilla);
115 }
116 }
117 @Test
118 public void test03URIEscapeCommonChars() throws IOException, URISyntaxException {
119 {
120 final String vanilla = "/XXX \"%-.<>\\^_`{|}~";
121 final Uri.Encoded escaped = Uri.Encoded.cast("/XXX%20%22%25-.%3C%3E%5C%5E_%60%7B%7C%7D~");
122 System.err.println("vanilla "+vanilla);
123 final Uri.Encoded esc1 = new Uri.Encoded(vanilla, Uri.PATH_LEGAL);
124 System.err.println("esc1 "+esc1);
125 Assert.assertEquals(escaped, esc1);
126
127 final String invEsc1 = esc1.decode();
128 System.err.println("inv(esc1) "+invEsc1);
129 Assert.assertEquals(vanilla, invEsc1);
130 showDump0x(vanilla);
131 }
132 }
133 private static void showDump0x(final String string) throws IOException, URISyntaxException {
134 final File file = new File(string);
135 System.err.println("file "+file);
136 System.err.println("file.path.dec "+file.getPath());
137 System.err.println("file.path.abs "+file.getAbsolutePath());
138 System.err.println("file.path.can "+file.getCanonicalPath());
139
140 System.err.println("File-path -> Uri:");
141 final Uri uri0 = Uri.valueOfFilepath(string);
142 URIDumpUtil.showUri(uri0);
143
144 System.err.println("Uri -> File:");
145 final Uri uri2 = Uri.valueOf(file);
146 URIDumpUtil.showUri(uri2);
147
148 System.err.println("Uri -> URI:");
149 final URI uri3 = uri2.toURI();
150 URIDumpUtil.showURI(uri3);
151
152 System.err.println("URI -> Uri (keep encoding):");
153 final Uri uri4 = Uri.valueOf(uri3);
154 URIDumpUtil.showUri(uri4);
155
156 System.err.println("URI -> Uri (re-encode):");
157 final Uri uri5 = Uri.valueOf(uri3);
158 URIDumpUtil.showUri(uri5);
159 }
160
161 @Test
162 public void test04EqualsAndHashCode() throws IOException, URISyntaxException {
163 {
164 final Uri uri0 = Uri.cast("http://localhost/test01.html#tag01");
165 final Uri uri1 = Uri.create("http", null, "localhost", -1, "/test01.html", null, "tag01");
166 final Uri uri2 = Uri.create("http", "localhost", "/test01.html", "tag01");
167
168 Assert.assertEquals(uri0, uri1);
169 Assert.assertEquals(uri0.hashCode(), uri1.hashCode());
170
171 Assert.assertEquals(uri0, uri2);
172 Assert.assertEquals(uri0.hashCode(), uri2.hashCode());
173
174 Assert.assertEquals(uri1, uri2);
175 Assert.assertEquals(uri1.hashCode(), uri2.hashCode());
176
177 final Uri uriA = Uri.create("http", null, "localhost", -1, "/test02.html", null, "tag01");
178 final Uri uriB = Uri.create("http", null, "localhost", -1, "/test01.html", null, "tag02");
179 final Uri uriC = Uri.create("http", null, "lalalhost", -1, "/test01.html", null, "tag01");
180 final Uri uriD = Uri.create("sftp", null, "localhost", -1, "/test01.html", null, "tag01");
181
182 Assert.assertNotEquals(uri1, uriA);
183 Assert.assertNotEquals(uri1, uriB);
184 Assert.assertNotEquals(uri1, uriC);
185 Assert.assertNotEquals(uri1, uriD);
186 }
187 { // 3 [scheme:][//[user-info@]host[:port]]path[?query][#fragment]
188 final Uri uri0 = Uri.cast("http://user@localhost:80/test01.html?test=01&test=02#tag01");
189 final Uri uri1 = Uri.create("http", "user", "localhost", 80, "/test01.html", "test=01&test=02", "tag01");
190
191 Assert.assertEquals(uri0, uri1);
192 Assert.assertEquals(uri0.hashCode(), uri1.hashCode());
193
194 final Uri uriA = Uri.cast("http://user@localhost:80/test01.html?test=01&test=02#tag02");
195 final Uri uriB = Uri.cast("http://user@localhost:80/test01.html?test=01&test=03#tag01");
196 final Uri uriC = Uri.cast("http://user@localhost:80/test04.html?test=01&test=02#tag01");
197 final Uri uriD = Uri.cast("http://user@localhost:88/test01.html?test=01&test=02#tag01");
198 final Uri uriE = Uri.cast("http://user@lalalhost:80/test01.html?test=01&test=02#tag01");
199 final Uri uriF = Uri.cast("http://test@localhost:80/test01.html?test=01&test=02#tag01");
200 final Uri uriG = Uri.cast("sftp://user@localhost:80/test01.html?test=01&test=02#tag01");
201
202 Assert.assertNotEquals(uri1, uriA);
203 Assert.assertNotEquals(uri1, uriB);
204 Assert.assertNotEquals(uri1, uriC);
205 Assert.assertNotEquals(uri1, uriD);
206 Assert.assertNotEquals(uri1, uriE);
207 Assert.assertNotEquals(uri1, uriF);
208 Assert.assertNotEquals(uri1, uriG);
209 }
210 }
211
212 @Test
213 public void test05Contained() throws IOException, URISyntaxException {
214 {
215 final Uri input = Uri.cast("http://localhost/test01.html#tag01");
216 final Uri contained = input.getContainedUri();
217 Assert.assertNull(contained);
218 }
219 {
220 final Uri input = Uri.cast("jar:http://localhost/test01.jar!/com/jogamp/Lala.class#tag01");
221 final Uri expected = Uri.cast("http://localhost/test01.jar#tag01");
222 final Uri contained = input.getContainedUri();
223 URIDumpUtil.showUri(input);
224 URIDumpUtil.showUri(contained);
225 Assert.assertEquals(expected, contained);
226 Assert.assertEquals(expected.hashCode(), contained.hashCode());
227 }
228 {
229 final Uri input = Uri.cast("jar:file://localhost/test01.jar!/");
230 final Uri expected = Uri.cast("file://localhost/test01.jar");
231 final Uri contained = input.getContainedUri();
232 URIDumpUtil.showUri(input);
233 URIDumpUtil.showUri(contained);
234 Assert.assertEquals(expected, contained);
235 Assert.assertEquals(expected.hashCode(), contained.hashCode());
236 }
237 {
238 final Uri input = Uri.cast("sftp:http://localhost/test01.jar?lala=01#tag01");
239 final Uri expected = Uri.cast("http://localhost/test01.jar?lala=01#tag01");
240 final Uri contained = input.getContainedUri();
241 URIDumpUtil.showUri(input);
242 URIDumpUtil.showUri(contained);
243 Assert.assertEquals(expected, contained);
244 Assert.assertEquals(expected.hashCode(), contained.hashCode());
245 }
246 }
247
248 @Test
249 public void test08NormalizedHierarchy() throws IOException, URISyntaxException {
250 {
251 final Uri input = Uri.cast("./dummy/nop/../a.txt");
252 final Uri expected = Uri.cast("dummy/a.txt");
253 URIDumpUtil.showUri(input);
254 final Uri normal = input.getNormalized();
255 Assert.assertEquals(expected, normal);
256 }
257 {
258 final Uri input = Uri.cast("../dummy/nop/../a.txt");
259 final Uri expected = Uri.cast("../dummy/a.txt");
260 URIDumpUtil.showUri(input);
261 final Uri normal = input.getNormalized();
262 Assert.assertEquals(expected, normal);
263 }
264 {
265 final Uri input = Uri.cast("http://localhost/dummy/../");
266 final Uri expected = Uri.cast("http://localhost/");
267 URIDumpUtil.showUri(input);
268 final Uri normal = input.getNormalized();
269 Assert.assertEquals(expected, normal);
270 }
271 {
272 final Uri input = Uri.cast("http://localhost/dummy/./../");
273 final Uri expected = Uri.cast("http://localhost/");
274 URIDumpUtil.showUri(input);
275 final Uri normal = input.getNormalized();
276 Assert.assertEquals(expected, normal);
277 }
278 {
279 final Uri input = Uri.cast("http://localhost/dummy/../aa/././../");
280 final Uri expected = Uri.cast("http://localhost/");
281 URIDumpUtil.showUri(input);
282 final Uri normal = input.getNormalized();
283 Assert.assertEquals(expected, normal);
284 }
285 {
286 final Uri input = Uri.cast("http://localhost/test/dummy/./../text.txt");
287 final Uri expected = Uri.cast("http://localhost/test/text.txt");
288 URIDumpUtil.showUri(input);
289 final Uri normal = input.getNormalized();
290 Assert.assertEquals(expected, normal);
291 }
292 {
293 final Uri input = Uri.cast("http://localhost/test/dummy/../text.txt?lala=01&lili=02#frag01");
294 final Uri expected = Uri.cast("http://localhost/test/text.txt?lala=01&lili=02#frag01");
295 URIDumpUtil.showUri(input);
296 final Uri normal = input.getNormalized();
297 Assert.assertEquals(expected, normal);
298 }
299 }
300
301 @Test
302 public void test09NormalizedOpaque() throws IOException, URISyntaxException {
303 {
304 final Uri input = Uri.cast("jar:http://localhost/dummy/../abc.jar!/");
305 final Uri expected = Uri.cast("jar:http://localhost/abc.jar!/");
306 URIDumpUtil.showUri(input);
307 final Uri normal = input.getNormalized();
308 Assert.assertEquals(expected, normal);
309 }
310 {
311 final Uri input = Uri.cast("jar:http://localhost/test/./dummy/../abc.jar!/");
312 final Uri expected = Uri.cast("jar:http://localhost/test/abc.jar!/");
313 URIDumpUtil.showUri(input);
314 final Uri normal = input.getNormalized();
315 Assert.assertEquals(expected, normal);
316 }
317 {
318 final Uri input = Uri.cast("jar:http://localhost/test/dummy/../abc.jar!/a/b/C.class");
319 final Uri expected = Uri.cast("jar:http://localhost/test/abc.jar!/a/b/C.class");
320 URIDumpUtil.showUri(input);
321 final Uri normal = input.getNormalized();
322 Assert.assertEquals(expected, normal);
323 }
324 {
325 final Uri input = Uri.cast("jar:http://localhost/test/dummy/../abc.jar!/a/b/C.class?lala=01&lili=02#frag01");
326 final Uri expected = Uri.cast("jar:http://localhost/test/abc.jar!/a/b/C.class?lala=01&lili=02#frag01");
327 URIDumpUtil.showUri(input);
328 final Uri normal = input.getNormalized();
329 Assert.assertEquals(expected, normal);
330 }
331 }
332
333 @Test
334 public void test10ParentAndDirHierarchy() throws IOException, URISyntaxException {
335 {
336 final Uri input = Uri.cast("http://localhost/");
337 URIDumpUtil.showUri(input);
338 final Uri directory = input.getDirectory();
339 Assert.assertEquals(input, directory);
340 final Uri parent = input.getParent();
341 Assert.assertNull(parent);
342 }
343 {
344 final Uri input = Uri.cast("http://localhost/dummy/../test/");
345 final Uri expectedD = Uri.cast("http://localhost/test/");
346 final Uri expectedP = Uri.cast("http://localhost/");
347 URIDumpUtil.showUri(input);
348 final Uri directory = input.getDirectory();
349 Assert.assertEquals(expectedD, directory);
350 final Uri parent = input.getParent();
351 Assert.assertEquals(expectedP, parent);
352 }
353 {
354 final Uri input = Uri.cast("http://localhost/dummy/../test/dummy/../");
355 final Uri expectedD = Uri.cast("http://localhost/test/");
356 final Uri expectedP = Uri.cast("http://localhost/");
357 URIDumpUtil.showUri(input);
358 final Uri directory = input.getDirectory();
359 Assert.assertEquals(expectedD, directory);
360 final Uri parent = input.getParent();
361 Assert.assertEquals(expectedP, parent);
362 }
363 {
364 final Uri input = Uri.cast("http://localhost/dir/test01.jar?lala=01#frag01");
365 final Uri expParen1 = Uri.cast("http://localhost/dir/?lala=01#frag01");
366 final Uri expFolde1 = expParen1;
367 final Uri expParen2 = Uri.cast("http://localhost/?lala=01#frag01");
368 final Uri expFolde2 = expParen1; // is folder already
369 final Uri expParen3 = null;
370 final Uri expFolde3 = expParen2;
371 Assert.assertNotEquals(input, expParen1);
372 Assert.assertNotEquals(expParen1, expParen2);
373 Assert.assertNotEquals(expParen1, expParen3);
374 URIDumpUtil.showUri(input);
375
376 final Uri parent1 = input.getParent();
377 Assert.assertEquals(expParen1, parent1);
378 Assert.assertEquals(expParen1.hashCode(), parent1.hashCode());
379 final Uri folder1 = input.getDirectory();
380 Assert.assertEquals(expFolde1, folder1);
381
382 final Uri parent2 = parent1.getParent();
383 Assert.assertEquals(expParen2, parent2);
384 Assert.assertEquals(expParen2.hashCode(), parent2.hashCode());
385 final Uri folder2 = parent1.getDirectory();
386 Assert.assertEquals(expFolde2, folder2);
387
388 final Uri parent3 = parent2.getParent();
389 Assert.assertEquals(expParen3, parent3); // NULL!
390 final Uri folder3 = parent2.getDirectory();
391 Assert.assertEquals(expFolde3, folder3); // NULL!
392 }
393 }
394
395 @Test
396 public void test11ParentAndDirOpaque() throws IOException, URISyntaxException {
397 {
398 final Uri input = Uri.cast("jar:http://localhost/test.jar!/");
399 URIDumpUtil.showUri(input);
400 final Uri directory = input.getDirectory();
401 Assert.assertEquals(input, directory);
402 final Uri parent = input.getParent();
403 Assert.assertNull(parent);
404 }
405 {
406 final Uri input = Uri.cast("jar:http://localhost/dummy/../test/test.jar!/");
407 final Uri expectedD = Uri.cast("jar:http://localhost/test/test.jar!/");
408 final Uri expectedP = null;
409 URIDumpUtil.showUri(input);
410 final Uri directory = input.getDirectory();
411 Assert.assertEquals(expectedD, directory);
412 final Uri parent = input.getParent();
413 Assert.assertEquals(expectedP, parent);
414 }
415 {
416 final Uri input = Uri.cast("jar:http://localhost/dummy/../test/dummy/../test.jar!/a/b/C.class");
417 final Uri expectedD = Uri.cast("jar:http://localhost/test/test.jar!/a/b/");
418 final Uri expectedP = Uri.cast("jar:http://localhost/test/test.jar!/a/b/");
419 URIDumpUtil.showUri(input);
420 final Uri directory = input.getDirectory();
421 Assert.assertEquals(expectedD, directory);
422 final Uri parent = input.getParent();
423 Assert.assertEquals(expectedP, parent);
424 }
425 {
426 final Uri input = Uri.cast("jar:http://localhost/test01.jar!/com/Lala.class?lala=01#frag01");
427 final Uri expParen1 = Uri.cast("jar:http://localhost/test01.jar!/com/?lala=01#frag01");
428 final Uri expFolde1 = expParen1;
429 final Uri expParen2 = Uri.cast("jar:http://localhost/test01.jar!/?lala=01#frag01");
430 final Uri expFolde2 = expParen1; // is folder already
431 final Uri expParen3 = null;
432 final Uri expFolde3 = expParen2; // is folder already
433 Assert.assertNotEquals(input, expParen1);
434 Assert.assertNotEquals(expParen1, expParen2);
435 Assert.assertNotEquals(expParen1, expParen3);
436 URIDumpUtil.showUri(input);
437
438 final Uri parent1 = input.getParent();
439 Assert.assertEquals(expParen1, parent1);
440 Assert.assertEquals(expParen1.hashCode(), parent1.hashCode());
441 final Uri folder1 = input.getDirectory();
442 Assert.assertEquals(expFolde1, folder1);
443
444 final Uri parent2 = parent1.getParent();
445 Assert.assertEquals(expParen2, parent2);
446 Assert.assertEquals(expParen2.hashCode(), parent2.hashCode());
447 final Uri folder2 = parent1.getDirectory();
448 Assert.assertEquals(expFolde2, folder2);
449
450 final Uri parent3 = parent2.getParent();
451 Assert.assertEquals(expParen3, parent3); // NULL
452 final Uri folder3 = parent2.getDirectory();
453 Assert.assertEquals(expFolde3, folder3);
454 }
455 }
456
457 public static void main(final String args[]) throws IOException {
458 final String tstname = TestUri01.class.getName();
459 org.junit.runner.JUnitCore.main(tstname);
460 }
461}
com.jogamp.common.net.TestUri01
Definition: TestUri01.java:19
com.jogamp.common.net.TestUri01.test04EqualsAndHashCode
void test04EqualsAndHashCode()
Definition: TestUri01.java:162
com.jogamp.common.net.TestUri01.main
static void main(final String args[])
Definition: TestUri01.java:457
com.jogamp.common.net.TestUri01.test11ParentAndDirOpaque
void test11ParentAndDirOpaque()
Definition: TestUri01.java:396
com.jogamp.common.net.TestUri01.test02URIEscapeSpecialChars
void test02URIEscapeSpecialChars()
Definition: TestUri01.java:81
com.jogamp.common.net.TestUri01.test08NormalizedHierarchy
void test08NormalizedHierarchy()
Definition: TestUri01.java:249
com.jogamp.common.net.TestUri01.test05Contained
void test05Contained()
Definition: TestUri01.java:213
com.jogamp.common.net.TestUri01.test00BasicCoding
void test00BasicCoding()
Definition: TestUri01.java:22
com.jogamp.common.net.TestUri01.test03URIEscapeCommonChars
void test03URIEscapeCommonChars()
Definition: TestUri01.java:118
com.jogamp.common.net.TestUri01.test09NormalizedOpaque
void test09NormalizedOpaque()
Definition: TestUri01.java:302
com.jogamp.common.net.TestUri01.test10ParentAndDirHierarchy
void test10ParentAndDirHierarchy()
Definition: TestUri01.java:334
com.jogamp.common.net.URIDumpUtil
Definition: URIDumpUtil.java:8
com.jogamp.common.net.URIDumpUtil.showURI
static void showURI(final URI uri)
Definition: URIDumpUtil.java:26
com.jogamp.common.net.URIDumpUtil.showUri
static void showUri(final Uri uri)
Definition: URIDumpUtil.java:46
com.jogamp.common.net.URIDumpUtil.showReencodedURIOfUri
static void showReencodedURIOfUri(final Uri uri)
Just showing different encoding of Uri -> URI.
Definition: URIDumpUtil.java:75
com.jogamp.common.net.Uri.Encoded
Immutable RFC3986 encoded string.
Definition: Uri.java:296
com.jogamp.common.net.Uri.Encoded.equals
final boolean equals(final Object o)
Definition: Uri.java:383
com.jogamp.common.net.Uri.Encoded.get
final String get()
Returns the encoded String.
Definition: Uri.java:336
com.jogamp.common.net.Uri.Encoded.decode
final String decode()
Decodes the string argument which is assumed to be encoded in the x-www-form-urlencoded MIME conten...
Definition: Uri.java:353
com.jogamp.common.net.Uri.Encoded.cast
static Encoded cast(final String encoded)
Casts the given encoded String by creating a new Encoded instance.
Definition: Uri.java:305
com.jogamp.common.net.Uri
This class implements an immutable Uri as defined by RFC 2396.
Definition: Uri.java:160
com.jogamp.common.net.Uri.HTTP_SCHEME
static final String HTTP_SCHEME
{@value}
Definition: Uri.java:285
com.jogamp.common.net.Uri.toASCIIString
ASCIIEncoded toASCIIString()
Returns the encoded input encoded in US-ASCII.
Definition: Uri.java:1308
com.jogamp.common.net.Uri.valueOf
static Uri valueOf(final File file)
Creates a new Uri instance using the given File instance.
Definition: Uri.java:1121
com.jogamp.common.net.Uri.hashCode
final int hashCode()
Definition: Uri.java:1845
com.jogamp.common.net.Uri.getNormalized
final Uri getNormalized()
Normalizes this Uri's path and return the normalized form if it differs, otherwise this instance.
Definition: Uri.java:1583
com.jogamp.common.net.Uri.PATH_LEGAL
static final String PATH_LEGAL
Valid charset for RFC 2396 path, additional to legal alphanum characters.
Definition: Uri.java:243
com.jogamp.common.net.Uri.valueOfFilepath
static Uri valueOfFilepath(final String path)
Creates a new Uri instance using the given file-path argument.
Definition: Uri.java:1087
com.jogamp.common.net.Uri.toString
final String toString()
Returns the encoded input as String, never null, same as getEncoded().
Definition: Uri.java:1301
com.jogamp.common.net.Uri.toURI
final java.net.URI toURI()
Returns a new URI instance using the encoded input string, new URI(uri.input), i.e.
Definition: Uri.java:1323
com.jogamp.common.net.Uri.getContainedUri
final Uri getContainedUri()
If this instance's schemeSpecificPart contains a Uri itself, a sub-Uri, return schemeSpecificPart + #...
Definition: Uri.java:1437
com.jogamp.common.net.Uri.FILE_SCHEME
static final String FILE_SCHEME
{@value}
Definition: Uri.java:283
com.jogamp.common.net.Uri.path
final Encoded path
Encoded path part of scheme-specific-part, never null.
Definition: Uri.java:1211
com.jogamp.common.net.Uri.getParent
final Uri getParent()
Returns this Uri's parent directory Uri.
Definition: Uri.java:1664
com.jogamp.common.net.Uri.equals
final boolean equals(final Object o)
Definition: Uri.java:1763
com.jogamp.common.net.Uri.getDirectory
Uri getDirectory()
Returns this Uri's directory Uri.
Definition: Uri.java:1622
com.jogamp.common.net.Uri.cast
static Uri cast(final String encodedUri)
Casts the given encoded String to a new Encoded instance used to create the resulting Uri instance vi...
Definition: Uri.java:1068
com.jogamp.common.net.Uri.create
static Uri create(final String scheme, final String ssp, final String fragment)
Creates a new Uri instance using the given unencoded arguments.
Definition: Uri.java:656
com.jogamp.common.net.Uri.getEncoded
final Encoded getEncoded()
Returns the encoded input, never null.
Definition: Uri.java:1293
com.jogamp.common.util.IOUtil
Definition: IOUtil.java:69
com.jogamp.common.util.IOUtil.slashify
static String slashify(final String path, final boolean startWithSlash, final boolean endWithSlash)
Definition: IOUtil.java:389
com.jogamp.junit.util.SingletonJunitCase
Definition: SingletonJunitCase.java:39