private byte [ ] getUploadFileContent ( RequestElements requestElements ) throws FMSException { Attachable attachable = ( Attachable ) requestElements . getEntity ( ) ; InputStream docContent = requestElements . getUploadRequestElements ( ) . getDocContent ( ) ; // gets the mime value form the filename String mime = getMime ( attachable . getFileName ( ) , "." ) ; // if null then gets the mime value from content-type of the file mime = ( mime != null ) ? mime : getMime ( attachable . getContentType ( ) , "/" ) ; if ( isImageType ( mime ) ) { return getImageContent ( docContent , mime ) ; } else { return getContent ( docContent ) ; } }
Method to get the file content of the upload file based on the mime type