fix: check if ContentCreateRequest has content field
@@ -213,6 +213,7 @@ public class GroupsResourceImpl implements GroupsResource {
public ArtifactMetaData updateArtifact(String groupId, String artifactId, String xRegistryVersion,
String xRegistryName, String xRegistryNameEncoded, String xRegistryDescription,
String xRegistryDescriptionEncoded, ContentCreateRequest data) {
+ requireParameter("content", data.getContent());
return this.updateArtifactWithRefs(groupId, artifactId, xRegistryVersion, xRegistryName, xRegistryNameEncoded, xRegistryDescription, xRegistryDescriptionEncoded, IoUtil.toStream(data.getContent()), data.getReferences());
}
@@ -626,6 +627,8 @@ public class GroupsResourceImpl implements GroupsResource {
String xRegistryDescription, String xRegistryDescriptionEncoded,
String xRegistryName, String xRegistryNameEncoded,
String xRegistryContentHash, String xRegistryHashAlgorithm, ContentCreateRequest data) {
+ requireParameter("content", data.getContent());
+
InputStream content = null;
try {
URL url = new URL(data.getContent());
@@ -823,6 +826,7 @@ public class GroupsResourceImpl implements GroupsResource {
public VersionMetaData createArtifactVersion(String groupId, String artifactId, String xRegistryVersion,
String xRegistryName, String xRegistryDescription, String xRegistryDescriptionEncoded,
String xRegistryNameEncoded, ContentCreateRequest data) {
+ requireParameter("content", data.getContent());
return this.createArtifactVersionWithRefs(groupId, artifactId, xRegistryVersion, xRegistryName, xRegistryDescription, xRegistryDescriptionEncoded, xRegistryNameEncoded, IoUtil.toStream(data.getContent()), data.getReferences());
}
