1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs2.provider.res;
18
19 import org.apache.commons.vfs2.FileName;
20 import org.apache.commons.vfs2.FileSystemException;
21 import org.apache.commons.vfs2.FileType;
22 import org.apache.commons.vfs2.provider.AbstractFileName;
23 import org.apache.commons.vfs2.provider.UriParser;
24
25
26
27
28 public class ResourceFileName extends AbstractFileName {
29
30 protected ResourceFileName(final String scheme, final String path, final FileType type) {
31 super(scheme, path, type);
32 }
33
34
35
36
37
38
39
40
41
42 @Override
43 public FileName createName(final String path, final FileType type) {
44 return new ResourceFileName(getScheme(), path, type);
45 }
46
47
48
49
50
51
52 @Override
53 public String toString() {
54 try {
55 return UriParser.decode(super.getURI());
56 } catch (final FileSystemException e) {
57 return super.getURI();
58 }
59 }
60
61
62
63
64 @Override
65 protected void appendRootUri(final StringBuilder buffer, final boolean addPassword) {
66 buffer.append(getScheme());
67 buffer.append(":");
68 }
69
70 @Override
71 public String getRootURI() {
72
73 return "";
74 }
75 }