code: public static Map<String, Attachment> loadAttachments(InputStream in) throws IOException {
  		ObjectMapper mapper = new ObjectMapper();
  		TypeReference<TreeMap<String, Attachment>> typeRef = new TypeReference<TreeMap<String, Attachment>>() {
  		};
  		TreeMap<String, Attachment> attachments;
  
  		try {
  			attachments = mapper.readValue(in, typeRef);
  			LOG.info("Attachments could be loaded");
  
  			for (Map.Entry<String, Attachment> entry : attachments.entrySet()) {
  				Attachment currentAttachment = entry.getValue();
  
  				if (!validateAttachment(currentAttachment)) {
  					throw new IOException("Attachment is not valid: " + currentAttachment.getAlternateId());
  				}
  			}
  			return attachments;
  		} catch (IOException e) {
  
  			throw new IOException("Attachments in the given file can not be loaded.");
  
  		}
  	}
docs: reads the attachments from the given inputstream and returns the
  attachment db
  
  @param in
  inputstream the given file containing all attachments
  @return attachment db
  @throws IOException
  if the attachments in the given file can not be loaded or an
  attachment is not valid