Examples of MediaType


Examples of org.eclipse.persistence.internal.oxm.MediaType

    @Override
    public void setMarshaller(MARSHALLER marshaller) {
        this.marshaller = marshaller;
        if(marshaller != null){
            MediaType mediaType = marshaller.getMediaType();
            if(marshaller.getNamespacePrefixMapper() != null){
                namespaceAware = true;             
            }else{
                namespaceAware = mediaType.isApplicationXML();
            }
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.oxm.MediaType

              if(value == null){
                   throw new PropertyException(key, Constants.EMPTY_STRING);                 
                 }
                xmlMarshaller.setEqualUsingIdenity(((Boolean) value).booleanValue());
            } else if (MarshallerProperties.MEDIA_TYPE.equals(key)) {
                MediaType mType = null;
                if(value instanceof MediaType) {
                    mType = (MediaType) value;
                } else if(value instanceof String) {
                    mType = MediaType.getMediaType((String)value);
                }
View Full Code Here

Examples of org.gatein.common.net.media.MediaType

      // prepare information for invocation
      final org.oasis.wsrp.v2.UserContext wsrpUserContext = getUserContext();
      checkUserContext(wsrpUserContext);
      SecurityContext securityContext = createSecurityContext(params, runtimeContext, wsrpUserContext);
      final MediaType mediaType = createMediaType(markupRequest);
      PortalContext portalContext = createPortalContext(params, markupRequest);
      UserContext userContext = createUserContext(wsrpUserContext, markupRequest.getLocale(), desiredLocales);
      String portletInstanceKey = runtimeContext.getPortletInstanceKey();
      instanceContext = createInstanceContext(portletContext, getAccessMode(), portletInstanceKey);
      WindowContext windowContext = createWindowContext(portletContext.getId(), runtimeContext);
View Full Code Here

Examples of org.jboss.aerogear.controller.router.MediaType

        assertThat(routes.hasRouteFor(GET, "/car/1", acceptHeaders(MediaType.HTML.getType()))).isTrue();
    }

    @Test
    public void restfulRoute() {
        final MediaType custom = new MediaType("application/custom", CustomResponder.class);
        Routes routes = new AbstractRoutingModule() {
            @Override
            public void configuration() {
                route().from("/car/{id}").on(GET).produces(MediaType.JSON, custom).to(SampleController.class).find(param("id"));
            }
View Full Code Here

Examples of org.jboss.portal.common.net.media.MediaType

   }

   public void setCharacterEncoding(String s)
   {
      List<Parameter> parameters = new ArrayList<Parameter>();
      MediaType mediaType = null;
     
      String contentTypeString = getContentType();
      if (contentTypeString != null)
      {
         ContentType contentType = ContentType.create(contentTypeString);
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

            // make sure we have a service instance
            serv = m_serviceMapper.getServiceInstance(req);
            if (serv == null) {
                rsp.sendError(HttpServletResponse.SC_NOT_FOUND);
            } else {
                MediaType intype = getMediaType(req.getContentType(), serv.getMediaTypeMapper());
                MediaType outtype = getAcceptableMediaType(req.getHeader("Accept"), intype);

                synchronized (s_codecPool) {
                    // allocated codec(s) and buffers for the input and output
                    incodec = s_codecPool.getCodec(intype);
                    if (intype.equals(outtype)) {
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

     * @param protocol the protocol that the service is using
     * @return media type with parameters removed
     * @throws ServletException if <code>mediastring</code> contains no supported media type
     */
    private MediaType getMediaType(String mediastring, MediaTypeMapper mapper) throws ServletException {
        MediaType media;
        if (mediastring == null) {
            try {
                media = mapper.getMediaTypeFor(null);
            } catch (WsConfigurationException e) {
                throw new ServletException("Internal JiBX/WS error. Unable to find default media type due to '"
                    + e.getMessage() + "'.");
            }
        } else {
            try {
                media = new MediaType(mediastring, true);
            } catch (ParseException e) {
                throw new ServletException("Error parsing media type in content-type from request: " + mediastring);
            }
            if (!CodecDirectory.hasCodecFor(media)) {
                throw new ServletException("No supported media type in content-type from request: " + mediastring);
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

            m_dimeOutput = new DimeOutputBuffer();
            OutByteBuffer obuff = new OutByteBuffer();
            m_dimeOutput.setBuffer(obuff);
            obuff.setOutput(m_socket.getOutputStream());
        }
        MediaType type = msgProps.getContentType();
        int typecode = type == null ? DimeCommon.TYPE_NONE : DimeCommon.TYPE_MEDIA;
        m_dimeOutput.nextMessage();
        m_dimeOutput.nextPart(null, typecode, type == null ? null : type.toString());
    }
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

        /** {@inheritDoc} */
        public IXMLWriter getNormalWriter(String[] uris) throws IOException {
            if (m_writer == null) {

                // first set the output content type
                MediaType contentType = m_codec.getMediaType();

                MediaType.Parameter charset = null;
                if (m_characterCode != null) {
                    charset = new MediaType.Parameter(CHARSET_KEY, m_characterCode);
                }
                m_response.setContentType(contentType.toStringWithParams(new MediaType.Parameter[]{charset}));

                // set up the actual writer
                OutputStream outputStream = m_response.getOutputStream();
                if (m_interceptor != null) {
                    outputStream = m_interceptor.intercept(outputStream);
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

                    InByteBuffer ibuff = new InByteBuffer();
                    m_dimeInput.setBuffer(ibuff);
                    ibuff.setInput(m_socket.getInputStream());
                }
                if (m_dimeInput.nextMessage() && m_dimeInput.nextPart()) {
                    MediaType mediaType = null;
                    if (m_dimeInput.getPartTypeCode() == DimeCommon.TYPE_MEDIA) {
                        String partTypeText = m_dimeInput.getPartTypeText();
                        try {
                            MediaType partMediaType = new MediaType(partTypeText);
                            if (CodecDirectory.hasCodecFor(partMediaType)) {
                                mediaType = partMediaType;
                            }
                        } catch (ParseException e) {
                            throw new IOException("Unable to parse media type '" + partTypeText + "'");
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.