Java Code Examples for

The following are Jave code examples for showing how to use setContentDisposition() of the class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: tdl-auth   File:   Source Code and License Vote up 5 votes
public String uploadPage(String pageContents) {
    String directory = generateDirectory();
    String path = directory + "/index.html";

    InputStream stream = new ByteArrayInputStream(pageContents.getBytes(StandardCharsets.UTF_8));
    ObjectMetadata metadata = new ObjectMetadata();
    metadata.setContentDisposition("inline; filename=\"index.html\"");
    PutObjectRequest request = new PutObjectRequest(bucket, path, stream, metadata)
    return s3client.getUrl(bucket, path).toString();