Examples of MediaType


Examples of org.jibx.ws.codec.MediaType

            connection.setRequestProperty(propertyName, props.getProperty(propertyName));
        }
    }
   
    private static String getContentTypeProperty(MessageProperties props) {
        MediaType contentType = props.getContentType();
        MediaType.Parameter charset = null;
        MediaType.Parameter action = null;
        if (props.getCharset() != null) {
            charset = new MediaType.Parameter(CHARSET_KEY, props.getCharset().toLowerCase());
        }
        if (props.getOperation() != null) {
            action = new MediaType.Parameter(ACTION_KEY, props.getOperation());
        }
        return contentType.toStringWithParams(new MediaType.Parameter[] {charset, action});
    }
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

        }
       
        /** {@inheritDoc} */
        public IXMLReader getReader() throws IOException, WsException {
            if (m_reader == null) {
                MediaType mediaType = getContentMediaType();
                m_buffer = (InByteBuffer)m_inBufferCache.getInstance();
               
                InputStream inputStream;
                if (hasError()) {
                    inputStream = m_connection.getErrorStream();
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

            }
            return m_reader;
        }

        private MediaType getContentMediaType() throws IOException {
            MediaType mediaType = null;
            String ctype = getContentType();
            MediaType contentType;
            if (ctype != null) {
                try {
                    contentType = new MediaType(ctype);
                } catch (ParseException e) {
                    throw new IOException("Unable to parse content-type '" + ctype + "'");
                }
                if (CodecDirectory.hasCodecFor(contentType)) {
                    mediaType = contentType;
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

                Service serv = null;
                try {
                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Beginning processing of receive message from " + m_clientAddress);
                    }
                    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

Examples of org.jibx.ws.codec.MediaType

         */
        public IXMLWriter getNormalWriter(String[] uris) throws IOException {
            if (!m_initialized) {
               
                // initialize DIME output first, then hook to writer, so data offset will be past header
                MediaType mediaType = m_codec.getMediaType();
                int typecode = mediaType == null ? DimeCommon.TYPE_NONE : DimeCommon.TYPE_MEDIA;
                m_dimeOutput.nextMessage();
                m_dimeOutput.nextPart(null, typecode, mediaType.toString());
                m_writer = m_codec.getWriter(m_dimeOutput, null, uris);
                initializeWriter(m_writer);
                m_initialized = true;
               
            }
View Full Code Here

Examples of org.jibx.ws.codec.MediaType

   * @param soapAction
   */
  private void assertRequestProperties(MessageProperties properties, String contentType, String charset, String acceptType, String soapAction) throws Exception {
        assertNotNull(properties);
        assertEquals("SOAPAction: ", soapAction, properties.getProperty("SOAPAction"));
        assertEquals("ContentType: ", new MediaType(contentType), properties.getContentType());
        assertEquals("Charset: ", charset, properties.getCharset());
        assertEquals("Accept types length: ", 1, properties.getAcceptTypes().length);
        assertEquals("Accept: ", new MediaType(acceptType), properties.getAcceptTypes()[0]);
  }
View Full Code Here

Examples of org.jitsi.service.neomedia.MediaType

        for(MediaDescription medToUpdate : prevMedias)
        {
            MediaDescription desc = null;
            try
            {
                MediaType type = getMediaType(medToUpdate);
                desc = removeMediaDesc(newMediaDescriptions, type);
            }
            catch (IllegalArgumentException e)
            {
                //remote party offers a stream of a type that we don't support.
View Full Code Here

Examples of org.openjena.atlas.web.MediaType

    }
    public static String mapLangToContentType(Lang lang) { return mapLangToContentType.get(lang) ; }
   
    public static String getCharsetForContentType(String contentType)
    {
        MediaType ct = MediaType.create(contentType) ;
        if ( ct.getCharset() != null )
            return ct.getCharset() ;
       
        String mt = ct.getContentType() ;
        if ( contentTypeNTriples.equals(mt) )       return charsetASCII ;
        if ( contentTypeNTriplesAlt.equals(mt) )    return charsetASCII ;
        if ( contentTypeNQuads.equals(mt) )         return charsetASCII ;
        if ( contentTypeNQuadsAlt.equals(mt) )      return charsetASCII ;
        return charsetUTF8 ;
View Full Code Here

Examples of org.restlet.client.data.MediaType

            if (charSet != null) {
                parameters.removeAll("charset");
                characterSet = new CharacterSet(charSet);
            }

            return new ContentType(new MediaType(mediaType.toString(),
                    parameters), characterSet);
        }

        return new ContentType(new MediaType(mediaType.toString()), null);
    }
View Full Code Here

Examples of org.restlet.data.MediaType

    // Add available file formats
    List<MediaType> mediaTypes = new ArrayList<MediaType>();

    for (FileFormat format : registry.getKeys()) {
      for (String mimeType : format.getMIMETypes()) {
        mediaTypes.add(new MediaType(mimeType));
      }
    }

    addCacheableMediaTypes(mediaTypes);
  }
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.