static boolean hasMimeType(final HttpServletRequest req, final String mimeType) { final String contentType = req.getContentType(); return contentType != null && mimeType.equals(new MiniMime(contentType).getMimeType()); }
return null; final MiniMime mimeType = new MiniMime(contentType); return mimeType.getContentEncoding();
/** * Return the value of the <code>charset</code>. * <p> * Note: Per Section 3.7.1 Canonicalization and Text Defaults of the HTTP * 1.1 specification: * <ul> * <li> * The "charset" parameter is used with some media types to define the * character set (section 3.4) of the data. When no explicit charset * parameter is provided by the sender, media subtypes of the "text" type * are defined to have a default charset value of "ISO-8859-1" when received * via HTTP. Data in character sets other than "ISO-8859-1" or its subsets * MUST be labeled with an appropriate charset value. See section 3.4.1 for * compatibility problems.</li> * </ul> * * @return The value of the <code>charset</code> parameter and * <code>null</code> if that parameter was not given. */ public String getContentEncoding() { // return getParam("charset","ISO-8859-1"); return getParam("charset", null); }
static boolean hasMimeType(final HttpServletRequest req, final String mimeType) { final String contentType = req.getContentType(); return contentType != null && mimeType.equals(new MiniMime(contentType).getMimeType()); }
/** * Post a GraphML file to the blueprints layer. */ @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { final String contentType = req.getContentType(); if (log.isInfoEnabled()) log.info("Request body: " + contentType); final String mimeType = new MiniMime(contentType).getMimeType().toLowerCase(); if (!mimeTypes.contains(mimeType)) { buildAndCommitResponse(resp, HTTP_BADREQUEST, MIME_TEXT_PLAIN, "Content-Type not recognized as graph data: " + contentType); return; } try { submitApiTask( new BlueprintsPostTask(req, resp, getNamespace(req), ITx.UNISOLATED)).get(); } catch (Throwable t) { BigdataRDFServlet.launderThrowable(t, resp, ""); } }
final MiniMime t = new MiniMime(s); .getMimeType()); .forMIMEType(t.getMimeType()); .forMIMEType(t.getMimeType()); .forMIMEType(t.getMimeType()); .forMIMEType(t.getMimeType());
final MiniMime t = new MiniMime(s); .getMimeType()); .forMIMEType(t.getMimeType()); .forMIMEType(t.getMimeType()); .forMIMEType(t.getMimeType()); .forMIMEType(t.getMimeType());
final String mimeType = new MiniMime( conn.getContentType()).getMimeType();
final String mimeType = new MiniMime( conn.getContentType()).getMimeType();
final RDFFormat format = RDFFormat.forMIMEType(new MiniMime( contentType).getMimeType());
final String mimeTypeStr = new MiniMime(contentType).getMimeType();
final RDFFormat format = RDFFormat.forMIMEType(new MiniMime( contentType).getMimeType());
final String mimeTypeStr = new MiniMime(contentType).getMimeType();
throw new RuntimeException("Not found: Content-Type"); final MiniMime mimeType = new MiniMime(contentType); final PropertiesFormat format = PropertiesFormat.forMIMEType(mimeType.getMimeType());
RDFFormat format = RDFFormat.forMIMEType(new MiniMime( contentType).getMimeType());
.forMIMEType(new MiniMime(contentType).getMimeType());
.forMIMEType(new MiniMime(contentType).getMimeType());
RDFFormat format = RDFFormat.forMIMEType(new MiniMime( contentType).getMimeType());
final RDFFormat requestBodyFormat = RDFFormat.forMIMEType(new MiniMime( contentType).getMimeType());
RDFFormat format = RDFFormat.forMIMEType(new MiniMime(contentType) .getMimeType());