diff --git a/bnd.bnd b/bnd.bnd new file mode 100644 index 0000000..844b5eb --- /dev/null +++ b/bnd.bnd @@ -0,0 +1,9 @@ +-exportcontents: com.pidoco.juri +-sources: true +Test-Cases: ${classes;CONCRETE;PUBLIC;NAMED;*Test} + +Bundle-Description: The JURI library. + +Import-Package: \ + javax.annotation; resolution:=optional; version=0, \ + * diff --git a/build.gradle b/build.gradle index 0c74d04..1af1046 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,15 @@ + +// got to use the buildscript way of specifying bnd plugin - plugins {id:...} fails +// because automatically expecting/searching workspace (cnf folder above project folder) +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:3.5.0' + } +} + apply plugin: 'java' group = 'com.pidoco' @@ -8,12 +20,15 @@ sourceCompatibility = 1.7 targetCompatibility = 1.7 dependencies { - - compile 'org.slf4j:slf4j-api:1.7.5' - compile 'com.google.code.findbugs:jsr305:2.0.0' + compile 'org.slf4j:slf4j-api:1.7.25' + compile 'com.google.code.findbugs:jsr305:3.0.2' compile 'com.google.guava:guava:18.0' // for URI element-specific escapers - compile 'org.apache.commons:commons-lang3:3.3.2' // using this for null checks, common string modifications etc - testCompile 'junit:junit:4.11' + compile 'org.apache.commons:commons-lang3:3.7' // using this for null checks, common string modifications etc + + // testing in OSGi environment requires these wrappers + testCompile 'org.osgi:osgi.enroute.junit.wrapper:4.12.0' + testCompile 'org.osgi:osgi.enroute.hamcrest.wrapper:1.3.0' + testRuntime 'org.slf4j:slf4j-simple:1.7.25' } repositories { @@ -44,6 +59,8 @@ publishing { } } +apply plugin: 'biz.aQute.bnd.builder' + apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'maven' @@ -98,10 +115,10 @@ uploadArchives { developer { id 'georgkoester' name 'Georg Koester' + email 'mail@georgkoester.de' } } } } } } - diff --git a/src/main/java/com/pidoco/juri/JURI.java b/src/main/java/com/pidoco/juri/JURI.java index 0647e38..d313f12 100644 --- a/src/main/java/com/pidoco/juri/JURI.java +++ b/src/main/java/com/pidoco/juri/JURI.java @@ -58,14 +58,14 @@ *

* The class doesn't verify the URI until {@link #getCurrentUri()} or any of the * methods calling it like {@link #toString()} are called. E.g. - * + *

+ * *
  *     cut = JURI.parse("http://[::1.1.1.1]")
  *     assertTrue(cut.setPath("dsfd/").isPathRelative());
  *     cut.getCurrentUri(); // fails here
  * 
- * - *

+ * * *

* This is a mutable class - so it doesn't provide an equals or hashCode @@ -583,12 +583,12 @@ public JURI addPathSegments(boolean slashAtEnd, String... segments) { /** *

-     *     "".addRawPath("") -> ""
-     *     "/".addRawPath("") -> "/"
-     *     "".addRawPath("/") -> "/"
-     *     "a".addRawPath("") -> "a/"
-     *     "a".addRawPath("b") -> "a/b"
-     *     "/".addRawPath("/") -> "/"
+     *     "".addRawPath("") -> ""
+     *     "/".addRawPath("") -> "/"
+     *     "".addRawPath("/") -> "/"
+     *     "a".addRawPath("") -> "a/"
+     *     "a".addRawPath("b") -> "a/b"
+     *     "/".addRawPath("/") -> "/"
      * 
*/ public JURI addRawPath(CharSequence toAdd) { @@ -599,12 +599,12 @@ public JURI addRawPath(CharSequence toAdd) { /** *
-     *     "".addRawPath("") -> ""
-     *     "/".addRawPath("") -> "/"
-     *     "".addRawPath("/") -> "/"
-     *     "a".addRawPath("") -> "a/"
-     *     "a".addRawPath("b") -> "a/b"
-     *     "/".addRawPath("/") -> "/"
+     *     "".addRawPath("") -> ""
+     *     "/".addRawPath("") -> "/"
+     *     "".addRawPath("/") -> "/"
+     *     "a".addRawPath("") -> "a/"
+     *     "a".addRawPath("b") -> "a/b"
+     *     "/".addRawPath("/") -> "/"
      * 
*/ public static String concatRawPaths(CharSequence left, CharSequence right) { @@ -655,7 +655,7 @@ public JURI setPath(@Nullable String unescapedPath) { * segments if escaped by backslash. * * @param completeUnescapedPath - * e.g. //b\/f//kf/ -> //b%XXf//kf/ + * e.g. //b\/f//kf/ -> //b%XXf//kf/ * @return the used string builder. */ public static StringBuilder escapeMultiSegmentPath(String completeUnescapedPath) {