public abstract class AssetResource<T extends Assetable> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AssetService<T> |
assetService |
protected AssetVisitor |
assetVisitor |
protected static org.slf4j.Logger |
logger |
protected Repository<T> |
repository |
| Constructor and Description |
|---|
AssetResource(AssetService<T> assetService,
Repository<T> repository,
AssetVisitor assetVisitor,
com.google.common.base.Optional<org.springframework.messaging.simp.SimpMessagingTemplate> messagingTemplate) |
| Modifier and Type | Method and Description |
|---|---|
<U extends Previewable & Identifiable> |
assets(String id) |
protected abstract void |
checkArtifactId(String artifactId) |
void |
deleteAsset(String id,
String assetId) |
void |
downloadAsset(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String id,
String type,
String filename,
String format) |
Asset |
saveAsset(Asset asset,
String id) |
org.springframework.http.ResponseEntity<Asset> |
saveOrUpdate(org.springframework.web.multipart.MultipartFile file,
String id,
String type) |
void |
updateAsset(String id,
String assetId,
Boolean increment,
Boolean decrement,
Boolean active) |
protected static final org.slf4j.Logger logger
protected AssetService<T extends Assetable> assetService
protected AssetVisitor assetVisitor
protected Repository<T extends Assetable> repository
public AssetResource(AssetService<T> assetService, Repository<T> repository, AssetVisitor assetVisitor, com.google.common.base.Optional<org.springframework.messaging.simp.SimpMessagingTemplate> messagingTemplate)
protected abstract void checkArtifactId(String artifactId)
@RequestMapping(value="/{artifactId}/assets/{type}",
method=POST,
produces="text/plain")
public org.springframework.http.ResponseEntity<Asset> saveOrUpdate(@RequestParam(value="file")
org.springframework.web.multipart.MultipartFile file,
@PathVariable(value="artifactId")
String id,
@PathVariable(value="type")
String type)
@RequestMapping(value="/{artifactId}/assets/{type}/{filename:.*}")
public void downloadAsset(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
@PathVariable(value="artifactId")
String id,
@PathVariable(value="type")
String type,
@PathVariable(value="filename")
String filename,
@RequestParam(value="format",required=false)
String format)
throws IOException
IOException@RequestMapping(value="/{artifactId}/assets",
method=POST)
public Asset saveAsset(@RequestBody
Asset asset,
@PathVariable(value="artifactId")
String id)
@RequestMapping(value="/{artifactId}/assets/{assetId}",
method=DELETE)
public void deleteAsset(@PathVariable(value="artifactId")
String id,
@PathVariable(value="assetId")
String assetId)
throws RepositoryException
RepositoryException@RequestMapping(value="/{artifactId}/assets")
public <U extends Previewable & Identifiable> Set<Asset> assets(@PathVariable(value="artifactId")
String id)
@RequestMapping(value="/{artifactId}/assets/{assetId}",
method=PUT)
public void updateAsset(@PathVariable(value="artifactId")
String id,
@PathVariable(value="assetId")
String assetId,
@RequestParam(value="increment",required=false)
Boolean increment,
@RequestParam(value="decrement",required=false)
Boolean decrement,
@RequestParam(value="active",required=false)
Boolean active)
Copyright © 2020. All rights reserved.