code: public static Part buildFilePart(final String name, final File file) throws IOException {
  		//Files.probeContentType(file.toPath()) always returns null due to unfixed jdk bug
  		//using Tika to fetch file mime type instead
  		final String type = new Tika().detect(file);
  		final FileContent content = new FileContent(type, file);
  		final Part part = new Part(content);
  		final HttpHeaders headers = new HttpHeaders();
  		final String disposition = String.format(Request.FILE_CONTENT_DISPOSITION, name, file.getName());
  		headers.set(Request.CONTENT_DISPOSITION, disposition);
  		part.setHeaders(headers);
  		return part;
  	}
docs: Static factory method that creates a {@link Part} which contains
  file form data.
  
  @param name name Name of the POST file data to create part for.
  @param file File of the POST data to create part for.
  @return Created data part.
  @throws IOException If any any error occurs during file type detection.