net/src/main/java/com/stanfy/enroscar/net/operation/BaseRequestBuilder.java
protected void addBinaryContent(final String name, final Uri data, final String contentType) {
    String contentName = RequestDescription.BINARY_NAME_DEFAULT;
    if (ContentResolver.SCHEME_FILE.equals(data.getScheme())) {
      try {
        contentName = new File(new URI(data.toString())).getName();
      } catch (final URISyntaxException e) {
        Log.e(TAG, "Bad file URI: " + data, e);
      }
    }
    addBinaryContent(name, contentName, data, contentType);
  }
protected void addBinaryContent(final String name, final Uri data, final String contentType) {
    String contentName = RequestDescription.BINARY_NAME_DEFAULT;
    if (ContentResolver.SCHEME_FILE.equals(data.getScheme())) {
      try {
        contentName = new File(new URI(data.toString())).getName();
      } catch (final URISyntaxException e) {
        Log.e(TAG, "Bad file URI: " + data, e);
      }
    }
    addBinaryContent(name, contentName, data, contentType);
  }
protected void addBinaryContent ( final String name , final Uri data , final String contentType ) { String contentName = RequestDescription . BINARY_NAME_DEFAULT ; if ( ContentResolver . SCHEME_FILE . equals ( data . getScheme ( ) ) ) { try { contentName = new File ( new URI ( data . toString ( ) ) ) . getName ( ) ; } catch ( final URISyntaxException e ) { Log . e ( TAG , "Bad file URI: " + data , e ) ; } } addBinaryContent ( name , contentName , data , contentType ) ; }
Setup binary content with the local file.
@param name parameter name
@param data content URI
@param contentType content MIME-type
Setup binary content with the local file .