Examples of withContentType()


Examples of com.basho.riak.client.builders.RiakObjectBuilder.withContentType()

        String ctype = o.getContentType();
        String charset = o.getCharset();

        if(CharsetUtils.hasCharset(ctype) || charset==null || "".equals(charset.trim())) {
            builder.withContentType(ctype);
        } else {
            builder.withContentType(ctype + CHARSET + charset);
        }

        final Map<String, String> userMetaData = new HashMap<String, String>(o.getUsermeta());
View Full Code Here

Examples of com.basho.riak.client.builders.RiakObjectBuilder.withContentType()

        String charset = o.getCharset();

        if(CharsetUtils.hasCharset(ctype) || charset==null || "".equals(charset.trim())) {
            builder.withContentType(ctype);
        } else {
            builder.withContentType(ctype + CHARSET + charset);
        }

        final Map<String, String> userMetaData = new HashMap<String, String>(o.getUsermeta());

        builder.withUsermeta(userMetaData);
View Full Code Here

Examples of com.basho.riak.client.builders.RiakObjectBuilder.withContentType()

            final Map value = (Map) values.get(0);
            final Map meta = (Map) value.get("metadata");
            final String contentType = (String) meta.get("content-type");

            b.withValue(asBytes((String) value.get("data"), getCharset(contentType)));
            b.withContentType(contentType);
            b.withVtag((String) meta.get("X-Riak-VTag"));

            Date lastModDate = ClientUtils.parseDate((String) meta.get("X-Riak-Last-Modified"));
            if (lastModDate != null)
                b.withLastModified(lastModDate.getTime());
View Full Code Here

Examples of com.basho.riak.client.builders.RiakObjectBuilder.withContentType()

            if (i instanceof com.basho.riak.client.http.BinIndex) {
                builder.addIndex(i.getName(), (String) i.getValue());
            }
        }

        builder.withContentType(o.getContentType());

        final Map<String, String> userMetaData = new HashMap<String, String>();

        for (String key : o.usermetaKeys()) {
            userMetaData.put(key, o.getUsermetaItem(key));
View Full Code Here

Examples of com.basho.riak.client.builders.RiakObjectBuilder.withContentType()

        String ctype = o.getContentType();
        String charset = o.getCharset();

        if(CharsetUtils.hasCharset(ctype) || charset==null || "".equals(charset.trim())) {
            builder.withContentType(ctype);
        } else {
            builder.withContentType(ctype + CHARSET + charset);
        }

        final Map<String, String> userMetaData = new HashMap<String, String>(o.getUsermeta());
View Full Code Here

Examples of com.basho.riak.client.builders.RiakObjectBuilder.withContentType()

        String charset = o.getCharset();

        if(CharsetUtils.hasCharset(ctype) || charset==null || "".equals(charset.trim())) {
            builder.withContentType(ctype);
        } else {
            builder.withContentType(ctype + CHARSET + charset);
        }

        final Map<String, String> userMetaData = new HashMap<String, String>(o.getUsermeta());

        builder.withUsermeta(userMetaData);
View Full Code Here

Examples of com.basho.riak.client.builders.RiakObjectBuilder.withContentType()

            final Map value = (Map) values.get(0);
            final Map meta = (Map) value.get("metadata");
            final String contentType = (String) meta.get("content-type");

            b.withValue(asBytes((String) value.get("data"), getCharset(contentType)));
            b.withContentType(contentType);
            b.withVtag((String) meta.get("X-Riak-VTag"));

            Date lastModDate = ClientUtils.parseDate((String) meta.get("X-Riak-Last-Modified"));
            if (lastModDate != null)
                b.withLastModified(lastModDate.getTime());
View Full Code Here

Examples of com.basho.riak.client.builders.RiakObjectBuilder.withContentType()

            if (i instanceof com.basho.riak.client.http.BinIndex) {
                builder.addIndex(i.getName(), (String) i.getValue());
            }
        }

        builder.withContentType(o.getContentType());

        final Map<String, String> userMetaData = new HashMap<String, String>();

        for (String key : o.usermetaKeys()) {
            userMetaData.put(key, o.getUsermetaItem(key));
View Full Code Here

Examples of org.apache.tapestry5.services.assets.StreamableResource.withContentType()

        if (contentType.getBaseType().equals("text")
                && ! contentType.hasParameters()
                && processing != StreamableResourceProcessing.FOR_AGGREGATION)
        {
            return resource.withContentType(contentType.withCharset("utf-8"));
        }

        return resource;
    }
}
View Full Code Here

Examples of org.jrack.RackResponse.withContentType()

            try {
                rackResponse = context.getRackResponse().withBody(file).withContentLength(file.length());
                if (configuration != null) {
                    Map<String, String> customMimeTypes = (Map<String, String>) configuration.get(CONFIG_ELEMENT_MIME_TYPES);
                    if (!CollectionUtils.isEmpty(customMimeTypes) && customMimeTypes.containsKey(fileType)) {
                        rackResponse.withContentType(customMimeTypes.get(fileType));
                    } else {
                        rackResponse.withContentType(Mime.mimeType(fileType));
                    }
                } else {
                    rackResponse.withContentType(Mime.mimeType(fileType));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.