use of org.eclipse.winery.repository.rest.resources.apiData.QNameWithTypeApiData in project winery by eclipse.
the class RestUtils method createArtifactTemplate.
public static ArtifactTemplateId createArtifactTemplate(InputStream uploadedInputStream, FormDataContentDisposition fileDetail, FormDataBodyPart body, QName artifactType, UriInfo uriInfo) {
ArtifactTemplatesResource templateResource = new ArtifactTemplatesResource();
QNameWithTypeApiData qNameApiData = new QNameWithTypeApiData();
qNameApiData.localname = "xaasPackager_" + fileDetail.getFileName();
qNameApiData.namespace = "http://opentosca.org/xaaspackager";
qNameApiData.type = artifactType.toString();
templateResource.onJsonPost(qNameApiData);
ArtifactTemplateId artifactTemplateId = new ArtifactTemplateId("http://opentosca.org/xaaspackager", "xaasPackager_" + fileDetail.getFileName(), false);
ArtifactTemplateResource atRes = new ArtifactTemplateResource(artifactTemplateId);
atRes.getFilesResource().onPost(uploadedInputStream, fileDetail, body, uriInfo);
return artifactTemplateId;
}
Aggregations