Skip to content

图片上传的 Java API #751

Answered by Him188
xingchenxuup asked this question in Q&A
Dec 22, 2020 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

2.0-M2-dev-11:

@NotNull
private <T> T magic() {
    throw new RuntimeException();
}

ExternalResource resource = magic();

public void externalResource() throws IOException {
    resource.inputStream();


    contact.uploadImage(resource); // base method


    ExternalResource r;

    r = ExternalResource.create((InputStream) magic()); // throws IOException
    r = ExternalResource.create((File) magic());
    r = ExternalResource.create((RandomAccessFile) magic());

    ExternalResource.uploadAsImage(r, contact);  // returns Image

    ExternalResource.sendAsImage(r, contact);    // returns MessageReceipt


    ExternalResource.uploadAsImage((ExternalResource) magic(), contact);    // r…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Him188

This comment has been hidden.

Answer selected by Him188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #751 on December 27, 2020 05:35.