Skip to content

Add new ParseFile constructors and update save method #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

wangmengyan95
Copy link
Contributor

Support creating a ParseFile with File.
New apis:

  1. public ParseFile(String name, File file, String contentType)
  2. public ParseFile(File file)
  3. public ParseFile(String name, File file)
  4. public ParseFile(File file, String contentType)

Update saveAsync() to support upload with a File pointer.

@wangmengyan95 wangmengyan95 changed the title Add new ParseFile constructors Add new ParseFile constructors and update save method Sep 9, 2015
@wangmengyan95 wangmengyan95 added this to the 1.10.2 milestone Sep 10, 2015
@grantland grantland modified the milestones: 1.10.2, 1.10.3 Sep 10, 2015
* @param contentType
* The file's content type.
*/
public ParseFile(String name, File file, String contentType) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any real reason we need to pass in name since we can get it from File#getName()?

/cc @nlutsenko since it looks like we have this constructor on iOS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have this constructor on iOS.
Simply fileWithContentsAtPath:, since you are right - we can get the file name by using the last path component.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@grantland grantland assigned nlutsenko and unassigned grantland Sep 18, 2015
@grantland
Copy link
Contributor

Passing to @nlutsenko for API discussion

@grantland
Copy link
Contributor

Let's keep the constructors to just the following:

  • new File(file, contentType)
  • new File(file)

We can determine name from File#getName(), and if you really want a different file name you can move the file first.

@wangmengyan95
Copy link
Contributor Author

Will revise the constructor. I forget we can get the name from file:(

@grantland
Copy link
Contributor

LGTM, one nit

@wangmengyan95 wangmengyan95 force-pushed the wangmengyan.t8120706_add_upload_file_stream_api branch from 632df8d to cbdf919 Compare September 22, 2015 04:25
wangmengyan95 added a commit that referenced this pull request Sep 22, 2015
…pload_file_stream_api

Add new ParseFile constructors and update save method
@wangmengyan95 wangmengyan95 merged commit 8012ff4 into master Sep 22, 2015
@wangmengyan95 wangmengyan95 deleted the wangmengyan.t8120706_add_upload_file_stream_api branch September 22, 2015 04:30
@grantland grantland modified the milestone: 1.11.0 Nov 11, 2015
@facebook-github-bot
Copy link

@wangmengyan95 updated the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants