Split URI regex strings differently
The strings used to construct the regex to parse URIs are split differently. This makes it easier to introduce meaningful String constants later on. Change-Id: I9355fd42e57e0983204465c5d6fe5b6b93655074 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
This commit is contained in:
parent
47e9e165b8
commit
0a2b4c1455
|
@ -63,16 +63,23 @@
|
||||||
public class URIish implements Serializable {
|
public class URIish implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Pattern FULL_URI = Pattern
|
private static final Pattern FULL_URI = Pattern.compile("^" //
|
||||||
.compile("^(?:([a-z][a-z0-9+-]+)://" // optional http://
|
+ "(?:" //
|
||||||
+ "(?:([^/]+?)(?::([^/]+?))?@)?" // optional user:password@
|
+ "([a-z][a-z0-9+-]+)://" // optional http://
|
||||||
+ "(?:([^/]+?))?(?::(\\d+))?)?" // optional example.com:1337
|
+ "(?:([^/]+?)(?::([^/]+?))?@)?" // optional user:password@
|
||||||
+ "((?:[A-Za-z]:)?" // optional drive-letter:
|
+ "(?:([^/]+?))?(?::(\\d+))?" // optional example.com:1337
|
||||||
+ "(?:\\.\\.)?" // optionally a relative path
|
+ ")?" //
|
||||||
+"/.+)$"); // /anything
|
+ "(" + "(?:[A-Za-z]:)?" // optional drive-letter:
|
||||||
|
+ "(?:\\.\\.)?" // optionally a relative path
|
||||||
|
+ "/.+" //
|
||||||
|
+ ")$"); // /anything
|
||||||
|
|
||||||
private static final Pattern SCP_URI = Pattern
|
private static final Pattern SCP_URI = Pattern.compile("^" //
|
||||||
.compile("^(?:([^@]+?)@)?([^:]+?):(.+)$");
|
+ "(?:([^@]+?)@)?" //
|
||||||
|
+ "([^:]+?)" //
|
||||||
|
+ ":" //
|
||||||
|
+ "(.+)" //
|
||||||
|
+ "$"); //
|
||||||
|
|
||||||
private String scheme;
|
private String scheme;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue