diff --git a/CODE_OF_CONDUCT.adoc b/CODE_OF_CONDUCT.adoc index f64fb1b7..33ae7bc9 100644 --- a/CODE_OF_CONDUCT.adoc +++ b/CODE_OF_CONDUCT.adoc @@ -24,4 +24,4 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be repor All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident. -This Code of Conduct is adapted from the http://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at http://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/]. \ No newline at end of file +This Code of Conduct is adapted from the https://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at https://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/]. \ No newline at end of file diff --git a/readme.md b/readme.md index 8a4f70c5..1ef5803b 100644 --- a/readme.md +++ b/readme.md @@ -1,11 +1,11 @@ -[![Spring Hateoas](https://spring.io/badges/spring-hateoas/ga.svg)](http://projects.spring.io/spring-hateoas/#quick-start) -[![Spring Hateoas](https://spring.io/badges/spring-hateoas/snapshot.svg)](http://projects.spring.io/spring-hateoas/#quick-start) +[![Spring Hateoas](https://spring.io/badges/spring-hateoas/ga.svg)](https://projects.spring.io/spring-hateoas/#quick-start) +[![Spring Hateoas](https://spring.io/badges/spring-hateoas/snapshot.svg)](https://projects.spring.io/spring-hateoas/#quick-start) # Spring Hateoas -This project provides some APIs to ease creating REST representations that follow the [HATEOAS](http://en.wikipedia.org/wiki/HATEOAS) principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly. +This project provides some APIs to ease creating REST representations that follow the [HATEOAS](https://en.wikipedia.org/wiki/HATEOAS) principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly. ## Resources -- Reference documentation - [html](http://docs.spring.io/spring-hateoas/docs/current/reference/html/), [pdf](http://docs.spring.io/spring-hateoas/docs/current/reference/pdf/spring-hateoas-reference.pdf) -- [JavaDoc](http://docs.spring.io/spring-hateoas/docs/current-SNAPSHOT/api/) +- Reference documentation - [html](https://docs.spring.io/spring-hateoas/docs/current/reference/html/), [pdf](https://docs.spring.io/spring-hateoas/docs/current/reference/pdf/spring-hateoas-reference.pdf) +- [JavaDoc](https://docs.spring.io/spring-hateoas/docs/current-SNAPSHOT/api/) - [Getting started guide](https://spring.io/guides/gs/rest-hateoas/) diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc index 775edb9c..fb461e25 100644 --- a/src/main/asciidoc/index.adoc +++ b/src/main/asciidoc/index.adoc @@ -5,7 +5,7 @@ Oliver Gierke; Greg Turnquist; Jay Bryant :toc: left :hide-uri-scheme: -This project provides some APIs to ease creating REST representations that follow the http://en.wikipedia.org/wiki/HATEOAS[HATEOAS] principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly. +This project provides some APIs to ease creating REST representations that follow the https://en.wikipedia.org/wiki/HATEOAS[HATEOAS] principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly. (C) 2012-2019 The original authors. @@ -287,7 +287,7 @@ List resources = assembler.toResources(people); [[configuration.at-enable]] === @EnableHypermediaSupport -To enable the `ResourceSupport` subtypes be rendered according to the specification of various hypermedia representations types, the support for a particular hypermedia representation format can be activated through `@EnableHypermediaSupport`. The annotation takes a `HypermediaType` enumeration as argument. Currently we support http://tools.ietf.org/html/draft-kelly-json-hal[HAL] as well as a default rendering. Using the annotation triggers the following: +To enable the `ResourceSupport` subtypes be rendered according to the specification of various hypermedia representations types, the support for a particular hypermedia representation format can be activated through `@EnableHypermediaSupport`. The annotation takes a `HypermediaType` enumeration as argument. Currently we support https://tools.ietf.org/html/draft-kelly-json-hal[HAL] as well as a default rendering. Using the annotation triggers the following: * registers necessary Jackson modules to render `Resource`/`Resources` in the hypermedia specific format. * if JSONPath is on the classpath, it automatically registers a `LinkDiscoverer` instance to lookup links by their `rel` in plain JSON representations (see <>). @@ -313,7 +313,7 @@ A `RelProvider` is exposed as Spring bean when using `@EnableHypermediaSupport` [[spis.curie-provider]] === CurieProvider API -The http://tools.ietf.org/html/rfc5988=section-4[Web Linking RFC] describes registered and extension link relation types. Registered rels are well-known strings registered with the http://www.iana.org/assignments/link-relations/link-relations.xhtml[IANA registry of link relation types]. Extension rels can be used by applications that do not wish to register a relation type. They are a URI that uniquely identifies the relation type. The rel URI can be serialized as a compact URI or http://www.w3.org/TR/curie[Curie]. E.g. a curie `ex:persons` stands for the link relation type `http://example.com/rels/persons` if `ex` is defined as `http://example.com/rels/{rels}`. If curies are used, the base URI must be present in the response scope. +The https://tools.ietf.org/html/rfc5988=section-4[Web Linking RFC] describes registered and extension link relation types. Registered rels are well-known strings registered with the https://www.iana.org/assignments/link-relations/link-relations.xhtml[IANA registry of link relation types]. Extension rels can be used by applications that do not wish to register a relation type. They are a URI that uniquely identifies the relation type. The rel URI can be serialized as a compact URI or https://www.w3.org/TR/curie[Curie]. E.g. a curie `ex:persons` stands for the link relation type `https://example.com/rels/persons` if `ex` is defined as `https://example.com/rels/{rels}`. If curies are used, the base URI must be present in the response scope. The rels created by the default `RelProvider` are extension relation types and as such must be URIs, which can cause a lot of overhead. The `CurieProvider` API takes care of that: it allows to define a base URI as URI template and a prefix which stands for that base URI. If a `CurieProvider` is present, the `RelProvider` prepends all rels with the curie prefix. Furthermore a `curies` link is automatically added to the HAL resource. @@ -328,7 +328,7 @@ public class Config { @Bean public CurieProvider curieProvider() { - return new DefaultCurieProvider("ex", new UriTemplate("http://www.example.com/rels/{rel}")); + return new DefaultCurieProvider("ex", new UriTemplate("https://www.example.com/rels/{rel}")); } } ---- @@ -342,7 +342,7 @@ Note that now the prefix `ex:` automatically appears before all rels which are n "self" : { href: "http://myhost/person/1" }, "curies" : { "name" : "ex", - "href" : "http://example.com/rels/{rel}", + "href" : "https://example.com/rels/{rel}", "templated" : true }, "ex:orders" : { href : "http://myhost/person/1/orders" } diff --git a/src/main/java/org/springframework/hateoas/IanaRels.java b/src/main/java/org/springframework/hateoas/IanaRels.java index 8c1dc836..b666b9bb 100644 --- a/src/main/java/org/springframework/hateoas/IanaRels.java +++ b/src/main/java/org/springframework/hateoas/IanaRels.java @@ -25,7 +25,7 @@ import java.util.HashSet; /** * Static class to find out whether a relation type is defined by the IANA. * - * @see http://www.iana.org/assignments/link-relations/link-relations.xhtml + * @see https://www.iana.org/assignments/link-relations/link-relations.xhtml * @author Oliver Gierke * @author Roland Kulcsár */ diff --git a/src/main/java/org/springframework/hateoas/UriTemplate.java b/src/main/java/org/springframework/hateoas/UriTemplate.java index 4e6cf26d..cd14c33a 100644 --- a/src/main/java/org/springframework/hateoas/UriTemplate.java +++ b/src/main/java/org/springframework/hateoas/UriTemplate.java @@ -35,7 +35,7 @@ import org.springframework.web.util.UriComponentsBuilder; * Custom URI template to support qualified URI template variables. * * @author Oliver Gierke - * @see http://tools.ietf.org/html/rfc6570 + * @see https://tools.ietf.org/html/rfc6570 * @since 0.9 */ public class UriTemplate implements Iterable, Serializable { diff --git a/src/main/java/org/springframework/hateoas/config/EnableHypermediaSupport.java b/src/main/java/org/springframework/hateoas/config/EnableHypermediaSupport.java index f818b9a6..b28e8182 100644 --- a/src/main/java/org/springframework/hateoas/config/EnableHypermediaSupport.java +++ b/src/main/java/org/springframework/hateoas/config/EnableHypermediaSupport.java @@ -69,7 +69,7 @@ public @interface EnableHypermediaSupport { * HAL - Hypermedia Application Language. * * @see http://stateless.co/hal_specification.html - * @see http://tools.ietf.org/html/draft-kelly-json-hal-05 + * @see https://tools.ietf.org/html/draft-kelly-json-hal-05 */ HAL; } diff --git a/src/main/java/org/springframework/hateoas/core/EvoInflectorRelProvider.java b/src/main/java/org/springframework/hateoas/core/EvoInflectorRelProvider.java index e325c791..30bf4151 100644 --- a/src/main/java/org/springframework/hateoas/core/EvoInflectorRelProvider.java +++ b/src/main/java/org/springframework/hateoas/core/EvoInflectorRelProvider.java @@ -22,7 +22,7 @@ import org.springframework.hateoas.RelProvider; * {@link RelProvider} implementation using the Evo Inflector implementation of an algorithmic approach to English * plurals. * - * @see http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html + * @see http://users.monash.edu/~damian/papers/HTML/Plurals.html * @author Oliver Gierke */ public class EvoInflectorRelProvider extends DefaultRelProvider { diff --git a/src/main/java/org/springframework/hateoas/hal/CurieProvider.java b/src/main/java/org/springframework/hateoas/hal/CurieProvider.java index 5ec84460..4feaec42 100644 --- a/src/main/java/org/springframework/hateoas/hal/CurieProvider.java +++ b/src/main/java/org/springframework/hateoas/hal/CurieProvider.java @@ -23,7 +23,7 @@ import org.springframework.hateoas.Links; /** * API to provide HAL curie information for links. * - * @see http://tools.ietf.org/html/draft-kelly-json-hal#section-8.2 + * @see https://tools.ietf.org/html/draft-kelly-json-hal#section-8.2 * @author Oliver Gierke * @author Jeff Stano * @since 0.9 diff --git a/src/main/java/org/springframework/hateoas/mvc/ForwardedHeader.java b/src/main/java/org/springframework/hateoas/mvc/ForwardedHeader.java index 182381b9..b9095a65 100644 --- a/src/main/java/org/springframework/hateoas/mvc/ForwardedHeader.java +++ b/src/main/java/org/springframework/hateoas/mvc/ForwardedHeader.java @@ -31,7 +31,7 @@ import org.springframework.web.util.UriComponentsBuilder; * Value object to partially implement the {@literal Forwarded} header defined in RFC 7239. * * @author Oliver Gierke - * @see http://tools.ietf.org/html/rfc7239 + * @see https://tools.ietf.org/html/rfc7239 * @deprecated In Spring 5.1, all Forwarded headers will by handled by Spring MVC. */ @Deprecated diff --git a/src/main/resources/license.txt b/src/main/resources/license.txt index 682d127a..964a55d1 100644 --- a/src/main/resources/license.txt +++ b/src/main/resources/license.txt @@ -207,7 +207,7 @@ similar licenses that require the source code and/or modifications to source code to be made available (as would be noted above), you may obtain a copy of the source code corresponding to the binaries for such open source components and modifications thereto, if any, (the "Source Files"), by -downloading the Source Files from http://www.springsource.org/download, +downloading the Source Files from https://www.springsource.org/download, or by sending a request, with your name and address to: VMware, Inc., 3401 Hillview Avenue, Palo Alto, CA 94304, United States of America or email info@vmware.com. All such requests should clearly specify: OPEN SOURCE FILES REQUEST, Attention General diff --git a/src/test/java/org/springframework/hateoas/LinkUnitTest.java b/src/test/java/org/springframework/hateoas/LinkUnitTest.java index 20d50c67..8284ef0e 100644 --- a/src/test/java/org/springframework/hateoas/LinkUnitTest.java +++ b/src/test/java/org/springframework/hateoas/LinkUnitTest.java @@ -113,13 +113,13 @@ public class LinkUnitTest { assertThat(Link.valueOf(";rel=\"foo\""), is(new Link("/something", "foo"))); assertThat(Link.valueOf(";rel=\"foo\";title=\"Some title\""), is(new Link("/something", "foo"))); - assertThat(Link.valueOf(";rel=\"self\";hreflang=\"en\";media=\"pdf\";title=\"pdf customer copy\";type=\"portable document\";deprecation=\"http://example.com/customers/deprecated\""), + assertThat(Link.valueOf(";rel=\"self\";hreflang=\"en\";media=\"pdf\";title=\"pdf customer copy\";type=\"portable document\";deprecation=\"https://example.com/customers/deprecated\""), is(new Link("/customer/1") .withHreflang("en") .withMedia("pdf") .withTitle("pdf customer copy") .withType("portable document") - .withDeprecation("http://example.com/customers/deprecated"))); + .withDeprecation("https://example.com/customers/deprecated"))); } /** @@ -214,7 +214,7 @@ public class LinkUnitTest { @Test public void parsesUriLinkRelations() { - assertThat(Link.valueOf("; rel=\"http://acme.com/rels/foo-bar\"").getRel(), - is("http://acme.com/rels/foo-bar")); + assertThat(Link.valueOf("; rel=\"https://acme.com/rels/foo-bar\"").getRel(), + is("https://acme.com/rels/foo-bar")); } } diff --git a/src/test/java/org/springframework/hateoas/alps/AlpsLinkDiscoverUnitTest.java b/src/test/java/org/springframework/hateoas/alps/AlpsLinkDiscoverUnitTest.java index 1a9a77fe..f416f079 100644 --- a/src/test/java/org/springframework/hateoas/alps/AlpsLinkDiscoverUnitTest.java +++ b/src/test/java/org/springframework/hateoas/alps/AlpsLinkDiscoverUnitTest.java @@ -41,7 +41,7 @@ public class AlpsLinkDiscoverUnitTest extends AbstractLinkDiscovererUnitTest { @Test public void discoversFullyQualifiedRel() { - Link link = getDiscoverer().findLinkWithRel("http://foo.com/bar", getInputString()); + Link link = getDiscoverer().findLinkWithRel("http://www.foo.com/bar", getInputString()); assertThat(link, is(notNullValue())); assertThat(link.getHref(), is("fullRelHref")); diff --git a/src/test/java/org/springframework/hateoas/alps/JacksonSerializationTest.java b/src/test/java/org/springframework/hateoas/alps/JacksonSerializationTest.java index aa353b56..15c1fce6 100644 --- a/src/test/java/org/springframework/hateoas/alps/JacksonSerializationTest.java +++ b/src/test/java/org/springframework/hateoas/alps/JacksonSerializationTest.java @@ -57,7 +57,7 @@ public class JacksonSerializationTest { public void writesSampleDocument() throws Exception { Alps alps = alps().// - doc(doc().href("http://example.org/samples/full/doc.html").build()). // + doc(doc().href("https://example.org/samples/full/doc.html").build()). // descriptors(Arrays.asList(// descriptor().id("search").type(Type.SAFE).// doc(new Doc("A search form with two inputs.", Format.TEXT)).// diff --git a/src/test/java/org/springframework/hateoas/client/TraversonTest.java b/src/test/java/org/springframework/hateoas/client/TraversonTest.java index 714583d3..4a6fe491 100644 --- a/src/test/java/org/springframework/hateoas/client/TraversonTest.java +++ b/src/test/java/org/springframework/hateoas/client/TraversonTest.java @@ -145,7 +145,7 @@ public class TraversonTest { @Test public void sendsConfiguredHeadersForJsonPathExpression() { - String expectedHeader = ";rel=\"home\""; + String expectedHeader = ";rel=\"home\""; HttpHeaders headers = new HttpHeaders(); headers.add("Link", expectedHeader); @@ -164,7 +164,7 @@ public class TraversonTest { @Test public void sendsConfiguredHeadersForToEntity() { - String expectedHeader = ";rel=\"home\""; + String expectedHeader = ";rel=\"home\""; HttpHeaders headers = new HttpHeaders(); headers.add("Link", expectedHeader); diff --git a/src/test/java/org/springframework/hateoas/hal/DefaultCurieProviderUnitTest.java b/src/test/java/org/springframework/hateoas/hal/DefaultCurieProviderUnitTest.java index 74fdc1f0..4ca1252a 100644 --- a/src/test/java/org/springframework/hateoas/hal/DefaultCurieProviderUnitTest.java +++ b/src/test/java/org/springframework/hateoas/hal/DefaultCurieProviderUnitTest.java @@ -70,17 +70,17 @@ public class DefaultCurieProviderUnitTest { @Test public void doesNotPrefixIanaRels() { - assertThat(provider.getNamespacedRelFrom(new Link("http://amazon.com")), is("self")); + assertThat(provider.getNamespacedRelFrom(new Link("https://amazon.com")), is("self")); } @Test public void prefixesNormalRels() { - assertThat(provider.getNamespacedRelFrom(new Link("http://amazon.com", "book")), is("acme:book")); + assertThat(provider.getNamespacedRelFrom(new Link("https://amazon.com", "book")), is("acme:book")); } @Test public void doesNotPrefixQualifiedRels() { - assertThat(provider.getNamespacedRelFrom(new Link("http://amazon.com", "custom:rel")), is("custom:rel")); + assertThat(provider.getNamespacedRelFrom(new Link("https://amazon.com", "custom:rel")), is("custom:rel")); } /** @@ -88,12 +88,12 @@ public class DefaultCurieProviderUnitTest { */ @Test public void prefixesNormalRelsThatHaveExtraRFC5988Attributes() { - assertThat(provider.getNamespacedRelFrom(new Link("http://amazon.com", "custom:rel") + assertThat(provider.getNamespacedRelFrom(new Link("https://amazon.com", "custom:rel") .withHreflang("en") .withTitle("the title") .withMedia("the media") .withType("the type") - .withDeprecation("http://example.com/custom/deprecated")), is("custom:rel")); + .withDeprecation("https://example.com/custom/deprecated")), is("custom:rel")); } /** diff --git a/src/test/java/org/springframework/hateoas/hal/HalLinkDiscovererUnitTest.java b/src/test/java/org/springframework/hateoas/hal/HalLinkDiscovererUnitTest.java index a78571ef..17b1f0a2 100644 --- a/src/test/java/org/springframework/hateoas/hal/HalLinkDiscovererUnitTest.java +++ b/src/test/java/org/springframework/hateoas/hal/HalLinkDiscovererUnitTest.java @@ -35,7 +35,7 @@ public class HalLinkDiscovererUnitTest extends AbstractLinkDiscovererUnitTest { static final LinkDiscoverer discoverer = new HalLinkDiscoverer(); static final String SAMPLE = "{ _links : { self : { href : 'selfHref' }, " + // "relation : [ { href : 'firstHref' }, { href : 'secondHref' }], " + // - "'http://foo.com/bar' : { href : 'fullRelHref' }, " + "}}"; + "'http://www.foo.com/bar' : { href : 'fullRelHref' }, " + "}}"; /** * @see #314 @@ -43,7 +43,7 @@ public class HalLinkDiscovererUnitTest extends AbstractLinkDiscovererUnitTest { @Test public void discoversFullyQualifiedRel() { - Link link = getDiscoverer().findLinkWithRel("http://foo.com/bar", SAMPLE); + Link link = getDiscoverer().findLinkWithRel("http://www.foo.com/bar", SAMPLE); assertThat(link, is(notNullValue())); assertThat(link.getHref(), is("fullRelHref")); diff --git a/src/test/resources/org/springframework/hateoas/alps/link-discoverer.json b/src/test/resources/org/springframework/hateoas/alps/link-discoverer.json index 993e277e..532bf726 100644 --- a/src/test/resources/org/springframework/hateoas/alps/link-discoverer.json +++ b/src/test/resources/org/springframework/hateoas/alps/link-discoverer.json @@ -1,7 +1,7 @@ { "version" : "1.0", "doc" : { - "href" : "http://example.org/samples/full/doc.html" + "href" : "https://example.org/samples/full/doc.html" }, "descriptors" : [ { "id" : "sfirst descriptor", @@ -17,7 +17,7 @@ "href" : "selfHref" }, { "id" : "fully qualified descriptor", - "name" : "http://foo.com/bar", + "name" : "http://www.foo.com/bar", "href" : "fullRelHref" } ] } diff --git a/src/test/resources/org/springframework/hateoas/alps/reference.json b/src/test/resources/org/springframework/hateoas/alps/reference.json index ffbd4dc2..82aab90d 100644 --- a/src/test/resources/org/springframework/hateoas/alps/reference.json +++ b/src/test/resources/org/springframework/hateoas/alps/reference.json @@ -1,7 +1,7 @@ { "version" : "1.0", "doc" : { - "href" : "http://example.org/samples/full/doc.html" + "href" : "https://example.org/samples/full/doc.html" }, "descriptor" : [ { "id" : "search",