Examples of withContentType()


Examples of org.jrack.RackResponse.withContentType()

                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));
                }
            } catch (FileNotFoundException e) {
View Full Code Here

Examples of org.jrack.RackResponse.withContentType()

                        rackResponse.withContentType(customMimeTypes.get(fileType));
                    } else {
                        rackResponse.withContentType(Mime.mimeType(fileType));
                    }
                } else {
                    rackResponse.withContentType(Mime.mimeType(fileType));
                }
            } catch (FileNotFoundException e) {
                throw new ControllerException("File not found: " + file.getAbsolutePath(), e);
            }
View Full Code Here

Examples of org.jrack.RackResponse.withContentType()

                if (response.getHeaders().get(Globals.HEADERS_CONTENT_TYPE) != null) {
                    contentType = response.getHeaders().get(Globals.HEADERS_CONTENT_TYPE);
                }

                response.withContentType(contentType)
                        .withContentLength(out.getBytes(Charset.forName(Globals.UTF8)).length)
                        .withBody(out);

                // We have a View served by
                // Faites vos jeux, rien ne va plus
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.