return new String(base64, "UTF-8");
} else {
return ZipUtils.deflateAndBase64EncodeFileContents(file);
}
} catch (IOException ex) {
throw new SourceDataEncodingException("Failed to compress and encode the contents of the file "
+ file.getAbsolutePath() + ". Reported reason: " + ex.getMessage(), ex);
}
}