Class RESTSampleAssemblyController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.web.controller.api.samples.RESTSampleAssemblyController
-
@Controller public class RESTSampleAssemblyController extends java.lang.Object
Controller for viewing and downloading assemblies for samples
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REL_ASSEMBLY_ANALYSIS
static java.lang.String
REL_SAMPLE
static java.lang.String
REL_SAMPLE_ASSEMBLIES
-
Constructor Summary
Constructors Constructor Description RESTSampleAssemblyController(SampleService sampleService, GenomeAssemblyService assemblyService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseResource<GenomeAssembly>
addNewAssemblyToSample(java.lang.Long sampleId, org.springframework.web.multipart.MultipartFile file, javax.servlet.http.HttpServletResponse response)
Upload a newGenomeAssembly
and add it to aSample
ResponseResource<ResourceCollection<GenomeAssembly>>
listAssembliesForSample(java.lang.Long sampleId)
List all theGenomeAssembly
s for a givenSample
ResponseResource<GenomeAssembly>
readAssemblyForSample(java.lang.Long sampleId, java.lang.Long assemblyId)
Read an individualGenomeAssembly
for a givenSample
-
-
-
Field Detail
-
REL_SAMPLE
public static final java.lang.String REL_SAMPLE
- See Also:
- Constant Field Values
-
REL_SAMPLE_ASSEMBLIES
public static final java.lang.String REL_SAMPLE_ASSEMBLIES
- See Also:
- Constant Field Values
-
REL_ASSEMBLY_ANALYSIS
public static final java.lang.String REL_ASSEMBLY_ANALYSIS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RESTSampleAssemblyController
@Autowired public RESTSampleAssemblyController(SampleService sampleService, GenomeAssemblyService assemblyService)
-
-
Method Detail
-
listAssembliesForSample
@RequestMapping(value="/api/samples/{sampleId}/assemblies", method=GET) public ResponseResource<ResourceCollection<GenomeAssembly>> listAssembliesForSample(@PathVariable java.lang.Long sampleId)
List all theGenomeAssembly
s for a givenSample
- Parameters:
sampleId
- the id of the sample- Returns:
- a list of details about the assemblies
-
readAssemblyForSample
@RequestMapping(value="/api/samples/{sampleId}/assemblies/{assemblyId}", method=GET) public ResponseResource<GenomeAssembly> readAssemblyForSample(@PathVariable java.lang.Long sampleId, @PathVariable java.lang.Long assemblyId)
Read an individualGenomeAssembly
for a givenSample
- Parameters:
sampleId
- the id of the sampleassemblyId
- the id of the assembly- Returns:
- details about the requested assembly
-
addNewAssemblyToSample
@RequestMapping(value="/api/samples/{sampleId}/assemblies", method=POST, consumes="multipart/form-data") public ResponseResource<GenomeAssembly> addNewAssemblyToSample(@PathVariable java.lang.Long sampleId, @RequestPart("file") org.springframework.web.multipart.MultipartFile file, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Upload a newGenomeAssembly
and add it to aSample
- Parameters:
sampleId
- The ID of the sampleto add the assembly tofile
- the file contentresponse
- A response to send to the user- Returns:
- a model with links to the created assembly
- Throws:
java.io.IOException
- if the upload fails
-
-