public class CatalogVersionMediaController
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MEDIA_URI_PATH |
| Constructor and Description |
|---|
CatalogVersionMediaController() |
| Modifier and Type | Method and Description |
|---|---|
protected DataMapper |
getDataMapper() |
MediaFileDto |
getFile(MultipartFile file,
java.io.InputStream inputStream)
Create a new media file DTO from the
MultipartFile. |
protected LocationHeaderResource |
getLocationHeaderResource() |
MediaData |
getMedia(HttpServletRequest request)
Deprecated.
since 6.4, method no longer used
|
MediaData |
getMediaByCode(HttpServletRequest request) |
protected MediaFacade |
getMediaFacade() |
protected java.util.Optional<java.lang.String> |
parseMediaCode(HttpServletRequest request)
Parses the Request URI after the Media code, which is defined by everything after the /media less the first '/', if
present.
|
void |
setDataMapper(DataMapper dataMapper) |
void |
setLocationHeaderResource(LocationHeaderResource locationHeaderResource) |
void |
setMediaFacade(MediaFacade mediaFacade) |
MediaData |
uploadMultipartMedia(java.lang.String catalogId,
java.lang.String versionId,
MediaData media,
MultipartFile multiPart,
HttpServletRequest request,
HttpServletResponse response)
Upload a media.
|
public static final java.lang.String MEDIA_URI_PATH
public MediaData uploadMultipartMedia(java.lang.String catalogId, java.lang.String versionId, MediaData media, MultipartFile multiPart, HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, WebserviceValidationException
catalogId - the unique identifier of the catalog for which to link the new media.versionId - the specific catalog version to which the new media will be associated to.media - the MediaData containing the data for the associated media item to be created.multiPart - the file that was uploaded for the new media.request - the HttpServletRequestresponse - the HttpServletResponsejava.io.IOException - when an error occurs parsing the MultipartFileWebserviceValidationException - when the media query parameters provided contain validation errorspublic MediaData getMediaByCode(HttpServletRequest request) throws MediaNotFoundException
MediaNotFoundExceptionprotected java.util.Optional<java.lang.String> parseMediaCode(HttpServletRequest request)
request - the http servlet request@Deprecated public MediaData getMedia(HttpServletRequest request)
request - - the http servlet requestpublic MediaFileDto getFile(MultipartFile file, java.io.InputStream inputStream)
MultipartFile.file - - a Spring MultipartFileinputStream - - an input stream used to read the fileprotected MediaFacade getMediaFacade()
public void setMediaFacade(MediaFacade mediaFacade)
protected LocationHeaderResource getLocationHeaderResource()
public void setLocationHeaderResource(LocationHeaderResource locationHeaderResource)
protected DataMapper getDataMapper()
public void setDataMapper(DataMapper dataMapper)
Copyright © 2017 SAP SE. All Rights Reserved.