code: public static String toBase64(File image) throws IOException {
          return "data:" + MimeType.getByFilename(image.getName()) + ";base64," + BaseEncoding.base64().encode(IOUtils.toByteArray(image));
      }
docs: Encode an image to base64 using a data: URI
  
  @param image The image file
  @return The base64 encoded value
  @throws java.io.IOException java.io.IOException