diff --git a/build.gradle b/build.gradle index 7c6eef3..1a2c95c 100644 --- a/build.gradle +++ b/build.gradle @@ -9,9 +9,9 @@ ext { slf4jVersion = "1.7.2" logbackVersion = "1.0.9" - springVersion = "3.2.2.RELEASE" + springVersion = "4.1.6.RELEASE" springShellVersion = "1.1.0.RELEASE" - hateoasVersion = "0.4.0.RELEASE" + hateoasVersion = "0.16.0.RELEASE" jacksonVersion = "1.9.12" junitVersion = "4.11" diff --git a/src/main/java/org/springframework/data/rest/shell/commands/ConfigurationCommands.java b/src/main/java/org/springframework/data/rest/shell/commands/ConfigurationCommands.java index e7bb636..ac57bc8 100644 --- a/src/main/java/org/springframework/data/rest/shell/commands/ConfigurationCommands.java +++ b/src/main/java/org/springframework/data/rest/shell/commands/ConfigurationCommands.java @@ -7,6 +7,7 @@ import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.SerializationConfig; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.data.rest.shell.context.BaseUriChangedEvent; @@ -29,7 +30,7 @@ public class ConfigurationCommands implements CommandMarker, ApplicationEventPub @Autowired private ContextCommands contextCmds; - private URI baseUri = URI.create("http://localhost:8080"); + private URI baseUri = URI.create((System.getenv("REST_SHELL_BASEURI") == null ? "http://localhost:8080": System.getenv("REST_SHELL_BASEURI"))); private ApplicationEventPublisher ctx = null; private HttpHeaders headers = new HttpHeaders(); private ObjectMapper mapper = new ObjectMapper(); diff --git a/src/main/java/org/springframework/data/rest/shell/commands/DiscoveryCommands.java b/src/main/java/org/springframework/data/rest/shell/commands/DiscoveryCommands.java index 797628a..36d7dfd 100644 --- a/src/main/java/org/springframework/data/rest/shell/commands/DiscoveryCommands.java +++ b/src/main/java/org/springframework/data/rest/shell/commands/DiscoveryCommands.java @@ -11,6 +11,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; @@ -22,6 +23,7 @@ import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.hateoas.Link; +import org.springframework.hateoas.MediaTypes; import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpRequest; @@ -63,6 +65,9 @@ public class DiscoveryCommands implements CommandMarker, ApplicationEventPublish private Map resources = new HashMap(); private ApplicationEventPublisher ctx; + public DiscoveryCommands() { + } + private static String pad(String s, int len) { char[] pad = new char[len - s.length()]; Arrays.fill(pad, ' '); @@ -228,7 +233,7 @@ private class ExtractLinksHelper implements RequestCallback, ResponseExtractor