- if (result.getExportData().getType().equals(ExportResultType.BYTE_ARRAY)){
- byte[] exportData = (byte[])data.getExportData();
- if(exportData != null){
- FileOutputStream stream = new FileOutputStream(exportFile);
- stream.write(exportData);
- stream.close();
- }
+ if (result.getExportData().getType().equals(ExportResultType.BYTE_ARRAY) || result.getExportData().getType().equals(ExportResultType.LIST_BYTE_ARRAY)){
+ if (data.getExportData() instanceof byte[]){
+ byte[] exportData = (byte[])data.getExportData();
+ if(exportData != null){
+ FileOutputStream stream = new FileOutputStream(exportFile);
+ Writer out = new BufferedWriter(new OutputStreamWriter(
+ stream, "UTF8"));
+
+ stream.write(exportData);
+ out.flush();
+ stream.close();
+ }
+ }else if (data.getExportData() instanceof List<?>){
+ //TODO:This needs to be improved
+ List<byte[]> exportData = (List<byte[]>)data.getExportData();
+ if(exportData != null){
+ FileOutputStream stream = new FileOutputStream(exportFile);
+ Writer out = new BufferedWriter(new OutputStreamWriter(
+ stream, "UTF8"));
+
+ stream.write(exportData.get(0));
+ out.flush();
+ stream.close();
+ }
+ }
+