1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
package issrg.pba.rbac; |
33 |
|
|
34 |
|
import issrg.utils.ParsedURL; |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
@author |
46 |
|
|
|
|
| 64.4% |
Uncovered Elements: 16 (45) |
Complexity: 5 |
Complexity Density: 0.79 |
|
47 |
|
public class URLPrincipal implements java.security.Principal, |
48 |
|
issrg.utils.repository.Entry { |
49 |
|
ParsedURL pu; |
50 |
|
int port=-1; |
51 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
52 |
0
|
protected URLPrincipal(){}... |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
@param |
62 |
|
|
63 |
|
@throws |
64 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
9
|
public URLPrincipal(String url) throws BadURLException {... |
66 |
9
|
this(url, -1); |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
@param |
74 |
|
@param |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
@throws |
79 |
|
|
|
|
| 58.8% |
Uncovered Elements: 7 (17) |
Complexity: 5 |
Complexity Density: 0.45 |
|
80 |
66
|
public URLPrincipal(String url, int defaultPort) throws BadURLException {... |
81 |
66
|
Exception e=null; |
82 |
|
|
83 |
66
|
pu=ParsedURL.parseURL(url); |
84 |
66
|
try{ |
85 |
66
|
if (pu!=null) |
86 |
0
|
if (pu.getPort()!=null) port=Integer.parseInt(pu.getPort()); |
87 |
66
|
else port=defaultPort; |
88 |
|
} catch (NumberFormatException nfe){ |
89 |
0
|
pu=null; |
90 |
0
|
e=nfe; |
91 |
|
} |
92 |
|
|
93 |
0
|
if (pu==null) throw new BadURLException("Malformed URL: "+url, e); |
94 |
|
} |
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
119
|
public String getName(){... |
101 |
119
|
return pu.getNormalizedURL(); |
102 |
|
} |
103 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
104 |
1023
|
public java.security.Principal getEntryName(){... |
105 |
1023
|
return this; |
106 |
|
} |
107 |
|
|
108 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
510
|
public String getProtocol(){... |
110 |
510
|
return pu.getProtocol(); |
111 |
|
} |
112 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
113 |
906
|
public String getUserName(){... |
114 |
906
|
return pu.getUserName(); |
115 |
|
} |
116 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
117 |
906
|
public String getPassword(){... |
118 |
906
|
return pu.getPassword(); |
119 |
|
} |
120 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
121 |
770
|
public String getHost(){... |
122 |
770
|
return pu.getHost(); |
123 |
|
} |
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
@return |
131 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
453
|
public int getPort(){... |
133 |
453
|
return port; |
134 |
|
} |
135 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
136 |
453
|
public String [] getPath(){... |
137 |
453
|
return pu.getPath(); |
138 |
|
} |
139 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
140 |
0
|
public String [] getOriginalPath(){... |
141 |
0
|
return pu.getOriginalPath(); |
142 |
|
} |
143 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
144 |
0
|
public String getAnchor(){... |
145 |
0
|
return pu.getAnchor(); |
146 |
|
} |
147 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
0
|
public String getQuery(){... |
149 |
0
|
return pu.getQuery(); |
150 |
|
} |
151 |
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
156 |
0
|
public String getURL(){... |
157 |
0
|
return pu.getURL(); |
158 |
|
} |
159 |
|
|
160 |
|
} |