private void appendAtomContentPart(final XMLStreamWriter writer, final EntityInfoAggregator eia,
final Map<String, Object> data, final String selfLink) throws EntityProviderException, EdmException {
try {
EdmMapping entityTypeMapping = eia.getEntityType().getMapping();
String self = null;
String mediaResourceMimeType = null;
if (entityTypeMapping != null) {
String mediaResourceSourceKey = entityTypeMapping.getMediaResourceSourceKey();
if (mediaResourceSourceKey != null) {
self = (String) data.get(mediaResourceSourceKey);
}
if (self == null) {
self = selfLink + "/$value";
}
String mediaResourceMimeTypeKey = entityTypeMapping.getMediaResourceMimeTypeKey();
if (mediaResourceMimeTypeKey != null) {
mediaResourceMimeType = (String) data.get(mediaResourceMimeTypeKey);
}
if (mediaResourceMimeType == null) {
mediaResourceMimeType = ContentType.APPLICATION_OCTET_STREAM.toString();