src/csip/CatalogService.java
@@ -40,21 +40,19 @@ |
|
@GET |
@Produces(MediaType.TEXT_PLAIN) |
- public String getTextCatalog(@Context UriInfo uriInfo, @Context HttpServletRequest httpReq) { |
- return getJSONCatalog(uriInfo, httpReq); |
+ public String getTextCatalog(@Context HttpServletRequest httpReq) { |
+ return getJSONCatalog(httpReq); |
} |
|
|
@GET |
@Produces(MediaType.APPLICATION_JSON) |
- public String getJSONCatalog(@Context UriInfo uriInfo, @Context HttpServletRequest httpReq) { |
-// LOG.log(Level.INFO, "HTTP/GET {0}", uriInfo.getRequestUri().toString()); |
+ public String getJSONCatalog(@Context HttpServletRequest httpReq) { |
LOG.log(Level.INFO, "HTTP/GET {0}", httpReq.getRequestURL().toString()); |
|
return cat.get(Config.getRegistry(), (Registry r) -> { |
JSONArray o = new JSONArray(); |
try { |
-// String host = Services.toPublicURL(uriInfo.getRequestUri()).toString(); |
String host = Services.toPublicURL(httpReq.getRequestURL().toString()).toString(); |
if (!host.endsWith("/")) { |
host += "/"; |
src/csip/ModelDataService.java
@@ -2151,7 +2151,7 @@ |
if (files == null || files.length == 0) { |
return; |
} |
- URI cb = Services.toPublicURL(new URI(getCodebase())); |
+ URI cb = Services.toPublicURL(getCodebase()); |
String url = cb.toString(); |
URIBuilder b = new URIBuilder(); |
for (File f : files) { |
src/csip/utils/Services.java
@@ -288,24 +288,6 @@ |
} |
|
|
- public static URI toPublicURL(URI u) { |
- UriBuilder b = UriBuilder.fromUri(u); |
- String s = Config.getString("csip.public.scheme"); |
- if (s != null) { |
- b = b.scheme(s); |
- } |
- s = Config.getString("csip.public.host"); |
- if (s != null) { |
- b = b.host(s); |
- } |
- s = Config.getString("csip.public.port"); |
- if (s != null) { |
- b = b.port(Integer.parseInt(s)); |
- } |
- return b.build(); |
- } |
- |
- |
/** |
* Copy the formParameter (files) to a directory, if the file is an archive, |
* The content will be extracted. |