public InputFile setMedia(File mediaFile, String fileName) {
        this.newMediaFile = mediaFile;
        this.mediaName = fileName;
        this.attachName = "attach://" + fileName;
        this.isNew = true;
        return this;
    }
public InputFile setMedia ( File mediaFile , String fileName ) { this . newMediaFile = mediaFile ; this . mediaName = fileName ; this . attachName = "attach://" + fileName ; this . isNew = true ; return this ; }
Use this setter to send new file.
@param mediaFile File to send
@param fileName Name of the file
@return This object