Package org.apache.marmotta.commons.http

Examples of org.apache.marmotta.commons.http.ContentType


        try {
            if(resultType == null) {
                List<ContentType> acceptedTypes = LMFHttpUtils.parseAcceptHeader(request.getHeader("Accept"));
                List<ContentType> offeredTypes  = LMFHttpUtils.parseStringList(Lists.newArrayList("application/sparql-results+xml","application/sparql-results+json","text/html", "application/rdf+xml", "text/csv"));

                ContentType bestType = LMFHttpUtils.bestContentType(offeredTypes,acceptedTypes);

                if(bestType != null) {
                    resultType = bestType.getMime();
                }
            }

            if(resultType != null) {
                String query = CharStreams.toString(request.getReader());
View Full Code Here


                return Response.ok().build();
            } else {
                if (resultType == null) {
                    List<ContentType> acceptedTypes = LMFHttpUtils.parseAcceptHeader(request.getHeader("Accept"));
                    List<ContentType> offeredTypes = LMFHttpUtils.parseStringList(Lists.newArrayList("*/*", "text/html"));
                    ContentType bestType = LMFHttpUtils.bestContentType(offeredTypes, acceptedTypes);
                    if (bestType != null) {
                        resultType = bestType.getMime();
                    }
                }
                if (parseSubType(resultType).equals("html"))
                    return Response.seeOther(new URI(configurationService.getServerUri() + "sparql/admin/update.html")).build();
                else
View Full Code Here

TOP

Related Classes of org.apache.marmotta.commons.http.ContentType

Copyright © 2018 www.massapicom. 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.