|
static String | checkAppServer (String server, boolean secured) |
|
static String[] | splitPath (String path) |
|
static String | absolute (String appServer, String path) throws URISyntaxException, MalformedURLException |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 35 of file URLUtil.java.
◆ absolute()
static String org.turro.http.URLUtil.absolute |
( |
String |
appServer, |
|
|
String |
path |
|
) |
| throws URISyntaxException, MalformedURLException |
|
static |
Definition at line 77 of file URLUtil.java.
78 URI url =
new URI(path);
79 if(url.isAbsolute()) {
82 return new URL(
new URL(appServer), path).toString();
◆ checkAppServer()
static String org.turro.http.URLUtil.checkAppServer |
( |
String |
server, |
|
|
boolean |
secured |
|
) |
| |
|
static |
Definition at line 37 of file URLUtil.java.
39 URIBuilder url =
new URIBuilder(server);
40 if(url.getScheme() ==
null) {
41 if(secured) url.setScheme(
"https");
else url.setScheme(
"http");
43 if(url.getHost() ==
null) {
47 url.setPath(
"/" + path[1]);
53 if(path !=
null && path.length > 0) {
54 url.setPath(
"/" + path[0]);
60 return url.build().toString();
61 }
catch (URISyntaxException ex) {
62 Logger.getLogger(URLUtil.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static String[] splitPath(String path)
◆ splitPath()
static String [] org.turro.http.URLUtil.splitPath |
( |
String |
path | ) |
|
|
static |
Definition at line 67 of file URLUtil.java.
68 if(!Strings.isBlank(path)) {
69 path = path.replaceFirst(
"^[\\/ ]+",
"");
70 path = path.replaceFirst(
"[\\/ ]+$",
"");
71 return path.split(
"\\/");
The documentation for this class was generated from the following file: