Skip to content

Commit 9b2164f

Browse files
committed
Delete contentful references
See gh-21
1 parent d202951 commit 9b2164f

25 files changed

+1
-1974
lines changed

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ dependencies {
4141
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
4242
implementation 'org.springframework.boot:spring-boot-starter-graphql'
4343
implementation 'com.azure.spring:spring-cloud-azure-starter-keyvault-secrets'
44-
implementation 'com.contentful.java:cma-sdk:3.4.12'
4544
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
4645
implementation 'com.vladsch.flexmark:flexmark-all:0.64.8'
4746
implementation 'org.apache.maven:maven-artifact:3.6.3'

src/main/java/io/spring/projectapi/Application.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,19 @@
1717
package io.spring.projectapi;
1818

1919
import com.fasterxml.jackson.databind.ObjectMapper;
20-
import io.spring.projectapi.ApplicationProperties.Contentful;
2120
import io.spring.projectapi.ApplicationProperties.Github;
22-
import io.spring.projectapi.contentful.ContentfulService;
2321
import io.spring.projectapi.github.GithubOperations;
2422

2523
import org.springframework.boot.SpringApplication;
2624
import org.springframework.boot.autoconfigure.SpringBootApplication;
2725
import org.springframework.boot.context.properties.EnableConfigurationProperties;
2826
import org.springframework.boot.web.client.RestTemplateBuilder;
2927
import org.springframework.context.annotation.Bean;
30-
import org.springframework.web.reactive.function.client.WebClient;
3128

3229
@SpringBootApplication
3330
@EnableConfigurationProperties(ApplicationProperties.class)
3431
public class Application {
3532

36-
private static final String BASE_URL = "https://graphql.contentful.com/content/v1/spaces/%s/environments/%s";
37-
38-
@Bean
39-
public ContentfulService contentfulService(ObjectMapper objectMapper, WebClient.Builder webClientBuilder,
40-
ApplicationProperties properties) {
41-
Contentful contentful = properties.getContentful();
42-
String accessToken = contentful.getAccessToken();
43-
String contentManagementToken = contentful.getContentManagementToken();
44-
String spaceId = contentful.getSpaceId();
45-
String environmentId = contentful.getEnvironmentId();
46-
String baseUrl = BASE_URL.formatted(spaceId, environmentId);
47-
WebClient webClient = webClientBuilder.baseUrl(baseUrl).build();
48-
return new ContentfulService(objectMapper, webClient, accessToken, contentManagementToken, spaceId,
49-
environmentId);
50-
}
51-
5233
@Bean
5334
public GithubOperations githubOperations(RestTemplateBuilder builder, ObjectMapper objectMapper,
5435
ApplicationProperties properties) {

src/main/java/io/spring/projectapi/ApplicationProperties.java

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -28,83 +28,17 @@
2828
@ConfigurationProperties(prefix = "projects")
2929
public class ApplicationProperties {
3030

31-
private final Contentful contentful;
32-
3331
private final Github github;
3432

3533
@ConstructorBinding
36-
ApplicationProperties(@DefaultValue Contentful contentful, @DefaultValue Github github) {
37-
this.contentful = contentful;
34+
ApplicationProperties(@DefaultValue Github github) {
3835
this.github = github;
3936
}
4037

41-
public Contentful getContentful() {
42-
return this.contentful;
43-
}
44-
4538
public Github getGithub() {
4639
return this.github;
4740
}
4841

49-
/**
50-
* Properties to access Contentful's API.
51-
*/
52-
public static class Contentful {
53-
54-
/**
55-
* Access token for Contentful's Content Delivery API.
56-
*
57-
* @see <a href=
58-
* "https://www.contentful.com/developers/docs/references/content-delivery-api/">Content
59-
* Delivery API</a>
60-
*/
61-
private String accessToken;
62-
63-
/**
64-
* Access token for Contentful's Content Management API.
65-
*
66-
* @see <a href=
67-
* "https://www.contentful.com/developers/docs/references/content-management-api/">Content
68-
* Management API</a>
69-
*/
70-
private String contentManagementToken;
71-
72-
/**
73-
* Contentful space id.
74-
*/
75-
private String spaceId;
76-
77-
/**
78-
* Contentful environment id.
79-
*/
80-
private String environmentId;
81-
82-
@ConstructorBinding
83-
Contentful(String accessToken, String contentManagementToken, String spaceId, String environmentId) {
84-
this.accessToken = accessToken;
85-
this.contentManagementToken = contentManagementToken;
86-
this.spaceId = spaceId;
87-
this.environmentId = environmentId;
88-
}
89-
90-
public String getAccessToken() {
91-
return this.accessToken;
92-
}
93-
94-
public String getSpaceId() {
95-
return this.spaceId;
96-
}
97-
98-
public String getEnvironmentId() {
99-
return this.environmentId;
100-
}
101-
102-
public String getContentManagementToken() {
103-
return this.contentManagementToken;
104-
}
105-
106-
}
107-
10842
/**
10943
* Properties to decide Github team membership.
11044
*/

src/main/java/io/spring/projectapi/contentful/ContentfulException.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/main/java/io/spring/projectapi/contentful/ContentfulOperations.java

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)