From 75d3d131bda538b6e666298cecb3f8e8ecc97fe0 Mon Sep 17 00:00:00 2001 From: Simon Brown Date: Fri, 20 Sep 2024 14:08:24 +0100 Subject: [PATCH] structurizr-client: Workspace archive file now includes the branch name in the filename. --- build.gradle | 2 +- changelog.md | 4 ++++ .../src/main/java/com/structurizr/api/WorkspaceApiClient.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 127bc7d2..bc0b040b 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ subprojects { proj -> description = 'Structurizr' group = 'com.structurizr' - version = '3.0.0' + version = '3.0.1' repositories { mavenCentral() diff --git a/changelog.md b/changelog.md index 3a510bf1..f3410dec 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 3.0.1 (unreleased) + +- structurizr-client: Workspace archive file now includes the branch name in the filename. + ## 3.0.0 (19th September 2024) - structurizr-client: Adds support to get/put workspace branches on the [cloud service](https://docs.structurizr.com/cloud/workspace-branches) and [on-premises installation](https://docs.structurizr.com/onpremises/workspace-branches). diff --git a/structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java b/structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java index 159a8fff..1ab4a715 100644 --- a/structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java +++ b/structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java @@ -415,7 +415,7 @@ private void debugArchivedWorkspaceLocation(File archiveFile) { private String createArchiveFileName(long workspaceId) { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); - return "structurizr-" + workspaceId + "-" + sdf.format(new Date()) + ".json"; + return "structurizr-" + workspaceId + "-" + (StringUtils.isNullOrEmpty(branch) ? "" : (branch + "-")) + sdf.format(new Date()) + ".json"; } public void setUser(String user) {