Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bnd.bnd
Original file line number Diff line number Diff line change
@@ -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, \
*
29 changes: 23 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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 {
Expand Down Expand Up @@ -44,6 +59,8 @@ publishing {
}
}

apply plugin: 'biz.aQute.bnd.builder'

apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
Expand Down Expand Up @@ -98,10 +115,10 @@ uploadArchives {
developer {
id 'georgkoester'
name 'Georg Koester'
email '[email protected]'
}
}
}
}
}
}

32 changes: 16 additions & 16 deletions src/main/java/com/pidoco/juri/JURI.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
* <p>
* The class doesn't verify the URI until {@link #getCurrentUri()} or any of the
* methods calling it like {@link #toString()} are called. E.g.
*
* </p>
*
* <pre>
* cut = JURI.parse("http://[::1.1.1.1]")
* assertTrue(cut.setPath("dsfd/").isPathRelative());
* cut.getCurrentUri(); // fails here
* </pre>
*
* </p>
*
*
* <p>
* This is a mutable class - so it doesn't provide an equals or hashCode
Expand Down Expand Up @@ -583,12 +583,12 @@ public JURI addPathSegments(boolean slashAtEnd, String... segments) {

/**
* <pre>
* "".addRawPath("") -> ""
* "/".addRawPath("") -> "/"
* "".addRawPath("/") -> "/"
* "a".addRawPath("") -> "a/"
* "a".addRawPath("b") -> "a/b"
* "/".addRawPath("/") -> "/"
* "".addRawPath("") -&gt; ""
* "/".addRawPath("") -&gt; "/"
* "".addRawPath("/") -&gt; "/"
* "a".addRawPath("") -&gt; "a/"
* "a".addRawPath("b") -&gt; "a/b"
* "/".addRawPath("/") -&gt; "/"
* </pre>
*/
public JURI addRawPath(CharSequence toAdd) {
Expand All @@ -599,12 +599,12 @@ public JURI addRawPath(CharSequence toAdd) {

/**
* <pre>
* "".addRawPath("") -> ""
* "/".addRawPath("") -> "/"
* "".addRawPath("/") -> "/"
* "a".addRawPath("") -> "a/"
* "a".addRawPath("b") -> "a/b"
* "/".addRawPath("/") -> "/"
* "".addRawPath("") -&gt; ""
* "/".addRawPath("") -&gt; "/"
* "".addRawPath("/") -&gt; "/"
* "a".addRawPath("") -&gt; "a/"
* "a".addRawPath("b") -&gt; "a/b"
* "/".addRawPath("/") -&gt; "/"
* </pre>
*/
public static String concatRawPaths(CharSequence left, CharSequence right) {
Expand Down Expand Up @@ -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/ -&gt; //b%XXf//kf/
* @return the used string builder.
*/
public static StringBuilder escapeMultiSegmentPath(String completeUnescapedPath) {
Expand Down