mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-05-26 17:24:47 +00:00
ACS-1677 Provide file extension from JMS request if missing in SFS (#428)
This commit is contained in:
parent
f831c46672
commit
74680fbe58
@ -230,7 +230,7 @@ public abstract class AbstractTransformerController implements TransformControll
|
|||||||
File sourceFile;
|
File sourceFile;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sourceFile = loadSourceFile(request.getSourceReference());
|
sourceFile = loadSourceFile(request.getSourceReference(), request.getSourceExtension());
|
||||||
}
|
}
|
||||||
catch (TransformException e)
|
catch (TransformException e)
|
||||||
{
|
{
|
||||||
@ -358,9 +358,10 @@ public abstract class AbstractTransformerController implements TransformControll
|
|||||||
* Loads the file with the specified sourceReference from Alfresco Shared File Store
|
* Loads the file with the specified sourceReference from Alfresco Shared File Store
|
||||||
*
|
*
|
||||||
* @param sourceReference reference to the file in Alfresco Shared File Store
|
* @param sourceReference reference to the file in Alfresco Shared File Store
|
||||||
|
* @param sourceExtension default extension if the file in Alfresco Shared File Store has none
|
||||||
* @return the file containing the source content for the transformation
|
* @return the file containing the source content for the transformation
|
||||||
*/
|
*/
|
||||||
private File loadSourceFile(final String sourceReference)
|
private File loadSourceFile(final String sourceReference, final String sourceExtension)
|
||||||
{
|
{
|
||||||
ResponseEntity<Resource> responseEntity = alfrescoSharedFileStoreClient
|
ResponseEntity<Resource> responseEntity = alfrescoSharedFileStoreClient
|
||||||
.retrieveFile(sourceReference);
|
.retrieveFile(sourceReference);
|
||||||
@ -369,7 +370,7 @@ public abstract class AbstractTransformerController implements TransformControll
|
|||||||
HttpHeaders headers = responseEntity.getHeaders();
|
HttpHeaders headers = responseEntity.getHeaders();
|
||||||
String filename = getFilenameFromContentDisposition(headers);
|
String filename = getFilenameFromContentDisposition(headers);
|
||||||
|
|
||||||
String extension = getFilenameExtension(filename);
|
String extension = getFilenameExtension(filename) != null ? getFilenameExtension(filename) : sourceExtension;
|
||||||
MediaType contentType = headers.getContentType();
|
MediaType contentType = headers.getContentType();
|
||||||
long size = headers.getContentLength();
|
long size = headers.getContentLength();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user