Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REST API] Updated the branch API to be a bit more REST compatible #4763

Merged
merged 11 commits into from
Jun 14, 2024
Merged
Prev Previous commit
Next Next commit
Additional fix for branch import/export
  • Loading branch information
EricWittmann committed Jun 12, 2024
commit 95fde8fd9f8aa1a03bf10a86e8dda081f98ed6a0
Original file line number Diff line number Diff line change
@@ -5,6 +5,6 @@
@RegisterForReflection
public enum EntityType {

Manifest, GlobalRule, Content, Group, ArtifactVersion, ArtifactRule, Comment, Branch
Manifest, GlobalRule, Content, Group, Artifact, ArtifactVersion, ArtifactRule, Comment, Branch

}
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ private void writeEntity(CommentEntity entity) throws IOException {
}

private void writeEntity(BranchEntity entity) throws IOException {
ZipEntry mdEntry = createZipEntry(EntityType.Branch, entity.groupId, entity.artifactId, "branches/" + entity.branchId, "json");
ZipEntry mdEntry = createZipEntry(EntityType.Branch, entity.groupId, entity.artifactId, entity.branchId, "json");
write(mdEntry, entity, BranchEntity.class);
}

@@ -122,6 +122,12 @@ private ZipEntry createZipEntry(EntityType type, String groupId, String artifact
case ArtifactRule:
path = String.format("groups/%s/artifacts/%s/rules/%s.%s.%s", groupOrDefault(groupId), artifactId, fileName, type.name(), fileExt);
break;
case Artifact:
path = String.format("groups/%s/artifacts/%s/%s.%s.%s", groupOrDefault(groupId), artifactId, fileName, type.name(), fileExt);
break;
case Branch:
path = String.format("groups/%s/artifacts/%s/branches/%s.%s.%s", groupOrDefault(groupId), artifactId, fileName, type.name(), fileExt);
break;
case ArtifactVersion:
path = String.format("groups/%s/artifacts/%s/versions/%s.%s.%s", groupOrDefault(groupId), artifactId, fileName, type.name(), fileExt);
break;
Loading