Skip to content

Commit 63b749d

Browse files
authored
Merge 281736c into f2087d2
2 parents f2087d2 + 281736c commit 63b749d

File tree

203 files changed

+3880
-2279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+3880
-2279
lines changed

hapi-deployable-pom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>ca.uhn.hapi.fhir</groupId>
77
<artifactId>hapi-fhir</artifactId>
8-
<version>6.9.2-SNAPSHOT</version>
8+
<version>6.9.3-SNAPSHOT</version>
99

1010
<relativePath>../pom.xml</relativePath>
1111
</parent>

hapi-fhir-android/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>ca.uhn.hapi.fhir</groupId>
77
<artifactId>hapi-deployable-pom</artifactId>
8-
<version>6.9.2-SNAPSHOT</version>
8+
<version>6.9.3-SNAPSHOT</version>
99

1010
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
1111
</parent>

hapi-fhir-base/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>ca.uhn.hapi.fhir</groupId>
77
<artifactId>hapi-deployable-pom</artifactId>
8-
<version>6.9.2-SNAPSHOT</version>
8+
<version>6.9.3-SNAPSHOT</version>
99

1010
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
1111
</parent>

hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/UriParamQualifierEnum.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@ public enum UriParamQualifierEnum {
4848
* Value <code>:below</code>
4949
* </p>
5050
*/
51-
BELOW(":below");
51+
BELOW(":below"),
52+
53+
/**
54+
* The contains modifier allows clients to indicate that a supplied URI input should be matched
55+
* as a case-insensitive and combining-character insensitive match anywhere in the target URI.
56+
* <p>
57+
* Value <code>:contains</code>
58+
* </p>
59+
*/
60+
CONTAINS(":contains");
5261

5362
private static final Map<String, UriParamQualifierEnum> KEY_TO_VALUE;
5463

hapi-fhir-base/src/main/java/ca/uhn/fhir/util/UrlUtil.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
import java.net.URISyntaxException;
4141
import java.net.URL;
4242
import java.net.URLDecoder;
43+
import java.nio.file.Path;
44+
import java.nio.file.Paths;
4345
import java.util.ArrayList;
4446
import java.util.Collection;
4547
import java.util.HashMap;
@@ -602,6 +604,39 @@ public static List<NameValuePair> translateMatchUrl(String theMatchUrl) {
602604
return parameters;
603605
}
604606

607+
/**
608+
* Creates list of sub URIs candidates for search with :above modifier
609+
* Example input: http://[host]/[pathPart1]/[pathPart2]
610+
* Example output: http://[host], http://[host]/[pathPart1], http://[host]/[pathPart1]/[pathPart2]
611+
*
612+
* @param theUri String URI parameter
613+
* @return List of URI candidates
614+
*/
615+
public static List<String> getAboveUriCandidates(String theUri) {
616+
try {
617+
URI uri = new URI(theUri);
618+
if (uri.getScheme() == null || uri.getHost() == null) {
619+
throwInvalidRequestExceptionForNotValidUri(theUri, null);
620+
}
621+
} catch (URISyntaxException theCause) {
622+
throwInvalidRequestExceptionForNotValidUri(theUri, theCause);
623+
}
624+
625+
List<String> candidates = new ArrayList<>();
626+
Path path = Paths.get(theUri);
627+
candidates.add(path.toString().replace(":/", "://"));
628+
while (path.getParent() != null && path.getParent().toString().contains("/")) {
629+
candidates.add(path.getParent().toString().replace(":/", "://"));
630+
path = path.getParent();
631+
}
632+
return candidates;
633+
}
634+
635+
private static void throwInvalidRequestExceptionForNotValidUri(String theUri, Exception theCause) {
636+
throw new InvalidRequestException(
637+
Msg.code(2419) + String.format("Provided URI is not valid: %s", theUri), theCause);
638+
}
639+
605640
public static class UrlParts {
606641
private String myParams;
607642
private String myResourceId;

hapi-fhir-bom/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>ca.uhn.hapi.fhir</groupId>
66
<artifactId>hapi-fhir-bom</artifactId>
7-
<version>6.9.2-SNAPSHOT</version>
7+
<version>6.9.3-SNAPSHOT</version>
88

99
<packaging>pom</packaging>
1010
<name>HAPI FHIR BOM</name>
1111

1212
<parent>
1313
<groupId>ca.uhn.hapi.fhir</groupId>
1414
<artifactId>hapi-deployable-pom</artifactId>
15-
<version>6.9.2-SNAPSHOT</version>
15+
<version>6.9.3-SNAPSHOT</version>
1616

1717
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
1818
</parent>

hapi-fhir-checkstyle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>ca.uhn.hapi.fhir</groupId>
77
<artifactId>hapi-fhir</artifactId>
8-
<version>6.9.2-SNAPSHOT</version>
8+
<version>6.9.3-SNAPSHOT</version>
99

1010
<relativePath>../pom.xml</relativePath>
1111
</parent>

hapi-fhir-cli/hapi-fhir-cli-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>ca.uhn.hapi.fhir</groupId>
66
<artifactId>hapi-deployable-pom</artifactId>
7-
<version>6.9.2-SNAPSHOT</version>
7+
<version>6.9.3-SNAPSHOT</version>
88

99
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
1010
</parent>

hapi-fhir-cli/hapi-fhir-cli-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>ca.uhn.hapi.fhir</groupId>
88
<artifactId>hapi-fhir-cli</artifactId>
9-
<version>6.9.2-SNAPSHOT</version>
9+
<version>6.9.3-SNAPSHOT</version>
1010

1111
<relativePath>../pom.xml</relativePath>
1212
</parent>

hapi-fhir-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>ca.uhn.hapi.fhir</groupId>
77
<artifactId>hapi-fhir</artifactId>
8-
<version>6.9.2-SNAPSHOT</version>
8+
<version>6.9.3-SNAPSHOT</version>
99

1010
<relativePath>../pom.xml</relativePath>
1111
</parent>

0 commit comments

Comments
 (0)