Search in sources :

Example 1 with GenericFileResource

use of org.eclipse.winery.repository.rest.resources._support.GenericFileResource in project winery by eclipse.

the class NodeTypeResource method uploadArtifact.

@Path("artifacts/{name}")
public GenericFileResource uploadArtifact(@PathParam("name") String name) {
    DirectoryId dir = new GenericDirectoryId(this.getId(), IdNames.FILES_DIRECTORY);
    DirectoryId files = new GenericDirectoryId(dir, name);
    return new GenericFileResource(files);
}
Also used : GenericFileResource(org.eclipse.winery.repository.rest.resources._support.GenericFileResource) DirectoryId(org.eclipse.winery.repository.datatypes.ids.elements.DirectoryId) GenericDirectoryId(org.eclipse.winery.repository.datatypes.ids.elements.GenericDirectoryId) GenericDirectoryId(org.eclipse.winery.repository.datatypes.ids.elements.GenericDirectoryId) Path(javax.ws.rs.Path)

Example 2 with GenericFileResource

use of org.eclipse.winery.repository.rest.resources._support.GenericFileResource in project winery by eclipse.

the class NodeTemplateResource method postYamlArtifactFile.

@Path("yamlartifacts/{artifactId}")
public GenericFileResource postYamlArtifactFile(@PathParam("artifactId") String id) {
    DirectoryId serviceTemplateYamlArtifactsDir = new GenericDirectoryId(getServiceTemplateResource().getId(), IdNames.FILES_DIRECTORY);
    DirectoryId nodeTemplateYamlArtifactsDir = new GenericDirectoryId(serviceTemplateYamlArtifactsDir, nodeTemplate.getId());
    DirectoryId yamlArtifactFilesDirectoryId = new GenericDirectoryId(nodeTemplateYamlArtifactsDir, id);
    return new GenericFileResource(yamlArtifactFilesDirectoryId);
}
Also used : GenericFileResource(org.eclipse.winery.repository.rest.resources._support.GenericFileResource) GenericDirectoryId(org.eclipse.winery.repository.datatypes.ids.elements.GenericDirectoryId) DirectoryId(org.eclipse.winery.repository.datatypes.ids.elements.DirectoryId) GenericDirectoryId(org.eclipse.winery.repository.datatypes.ids.elements.GenericDirectoryId) Path(javax.ws.rs.Path)

Aggregations

Path (javax.ws.rs.Path)2 DirectoryId (org.eclipse.winery.repository.datatypes.ids.elements.DirectoryId)2 GenericDirectoryId (org.eclipse.winery.repository.datatypes.ids.elements.GenericDirectoryId)2 GenericFileResource (org.eclipse.winery.repository.rest.resources._support.GenericFileResource)2