FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

staging | 29-09-2025 by harshithad0703 · Pull Request #231 · contentstack/contentstack-java · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (4) .md  (1) .xml  (1) All 3 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 6 additions & 0 deletions CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v2.3.0

### Date: 29-Sep-2025

- GCP-EU and AU region support

## v2.2.0

### Date: 25-Aug-2025
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.contentstack.sdk</groupId>
<artifactId>java</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
<packaging>jar</packaging>
<name>contentstack-java</name>
<description>Java SDK for Contentstack Content Delivery API</description>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/sdk/Config.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public Config setManagementToken(@NotNull String managementToken) {
* The enum Contentstack region. for now contentstack supports [US, EU, AZURE_NA]
*/
public enum ContentstackRegion {
US, EU, AZURE_NA, AZURE_EU, GCP_NA
US, EU, AZURE_NA, AZURE_EU, GCP_NA, GCP_EU, AU
}

}
10 changes: 10 additions & 0 deletions src/main/java/com/contentstack/sdk/Stack.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ protected void setConfig(Config config) {
urlDomain = "cdn.contentstack.com";
}
config.host = "gcp-na" + "-" + urlDomain;
} else if (region.equalsIgnoreCase("gcp_eu")) {
if (urlDomain.equalsIgnoreCase("cdn.contentstack.io")) {
urlDomain = "cdn.contentstack.com";
}
config.host = "gcp-eu" + "-" + urlDomain;
} else if (region.equalsIgnoreCase("au")) {
if (urlDomain.equalsIgnoreCase("cdn.contentstack.io")) {
urlDomain = "cdn.contentstack.com";
}
config.host = region + "-" + urlDomain;
}
}

Expand Down
11 changes: 11 additions & 0 deletions src/test/java/com/contentstack/sdk/TestGcpRegion.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@ void testGcpNARegionBehaviourGcpStackHost() throws IllegalAccessException {
Assertions.assertEquals("gcp-na-cdn.contentstack.com", stack.config.host);

}

@Test
void testGcpEURegionBehaviourGcpStack() throws IllegalAccessException {
Config config = new Config();
Config.ContentstackRegion region = Config.ContentstackRegion.GCP_EU;
config.setRegion(region);
Stack stack = Contentstack.stack("fakeApiKey", "fakeDeliveryToken", "fakeEnvironment", config);
Assertions.assertFalse(config.region.name().isEmpty());
Assertions.assertEquals("GCP_EU", stack.config.region.name());
Assertions.assertEquals("gcp-eu-cdn.contentstack.com", stack.config.host);
}
}
22 changes: 22 additions & 0 deletions src/test/java/com/contentstack/sdk/TestStack.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,26 @@ public void onCompletion(ResponseType responseType, Error error) {
});
}

@Test
@Order(44)
void testAURegionSupport() throws IllegalAccessException {
Config config = new Config();
Config.ContentstackRegion region = Config.ContentstackRegion.AU;
config.setRegion(region);
Assertions.assertFalse(config.region.name().isEmpty());
Assertions.assertEquals("AU", config.region.name());
}

@Test
@Order(45)
void testAURegionBehaviourStackHost() throws IllegalAccessException {
Config config = new Config();
Config.ContentstackRegion region = Config.ContentstackRegion.AU;
config.setRegion(region);
Stack stack = Contentstack.stack("fakeApiKey", "fakeDeliveryToken", "fakeEnvironment", config);
Assertions.assertFalse(config.region.name().isEmpty());
Assertions.assertEquals("au-cdn.contentstack.com", stack.config.host);

}

}
Loading

Back | FazBrowse Home | New Git URL