|
1 | 1 | package edu.kit.scc.dem.wapsrv.model.formats; |
2 | 2 |
|
3 | 3 | import java.io.IOException; |
4 | | -import java.net.MalformedURLException; |
5 | 4 | import java.net.URI; |
6 | 5 | import java.net.URISyntaxException; |
7 | | -import java.net.URL; |
8 | 6 | import java.util.*; |
9 | 7 | import java.util.regex.Pattern; |
10 | 8 | import org.apache.commons.collections4.map.ListOrderedMap; |
@@ -71,22 +69,6 @@ public JsonLdFormatter() { |
71 | 69 | super(Format.JSON_LD); |
72 | 70 | } |
73 | 71 |
|
74 | | - /** |
75 | | - * This is a helper method necessary to be able to use a static URL, |
76 | | - * otherwise the exception can not be caught. |
77 | | - * |
78 | | - * @param urlString The String to generate a URL from |
79 | | - * @return The generated URL Object |
80 | | - */ |
81 | | - private static URL makeUrl(String urlString) { |
82 | | - try { |
83 | | - return new URL(urlString); |
84 | | - } catch (MalformedURLException e) { |
85 | | - LoggerFactory.getLogger(ContentNegotiator.class).error("DEFAULT_PROFILE is an invalid URL : " + urlString); |
86 | | - return null; |
87 | | - } |
88 | | - } |
89 | | - |
90 | 72 | /** |
91 | 73 | * This is a helper method necessary to be able to use a static URL, |
92 | 74 | * otherwise the exception can not be caught. |
@@ -375,15 +357,12 @@ public void setAcceptPart(String profilesRaw, Type type) { |
375 | 357 | // The default profiles are always added if no accept header is given at all |
376 | 358 | if (profilesRaw == null || WapServerConfig.getInstance().shouldAlwaysAddDefaultProfilesToJsonLdRequests()) { |
377 | 359 | switch (type) { |
| 360 | + //TODO: check if this behaviour is working as intended |
378 | 361 | case CONTAINER: |
379 | | - if (!profiles.contains(LDP_PROFILE)) { |
380 | | - profiles.add(LDP_PROFILE); |
381 | | - } |
| 362 | + profiles.add(LDP_PROFILE); |
382 | 363 | case ANNOTATION: |
383 | 364 | case PAGE: |
384 | | - if (!profiles.contains(DEFAULT_PROFILE)) { |
385 | | - profiles.add(DEFAULT_PROFILE); |
386 | | - } |
| 365 | + profiles.add(DEFAULT_PROFILE); |
387 | 366 | break; |
388 | 367 | default: |
389 | 368 | // Unknown type ? do nothing because profile negotiation can be ignored by the server |
|
0 commit comments