org.apache.wink.common.utils
Class ProviderUtils

java.lang.Object
  extended by org.apache.wink.common.utils.ProviderUtils

public class ProviderUtils
extends java.lang.Object


Constructor Summary
ProviderUtils()
           
 
Method Summary
static void copyStream(java.io.InputStream src, java.io.OutputStream dst)
           
static java.io.Reader createReader(java.io.InputStream stream, javax.ws.rs.core.MediaType mediaType)
           
static java.io.Writer createWriter(java.io.OutputStream stream, javax.ws.rs.core.MediaType mediaType)
           
static java.lang.String getCharset(javax.ws.rs.core.MediaType m)
           
static java.lang.String getCharsetOrNull(javax.ws.rs.core.MediaType m)
           
static byte[] readFromStreamAsBytes(java.io.InputStream stream)
           
static java.lang.String readFromStreamAsString(java.io.InputStream stream, javax.ws.rs.core.MediaType mt)
           
static
<T> T
readFromString(javax.ws.rs.ext.Providers providers, java.lang.String input, java.lang.Class<T> type, javax.ws.rs.core.MediaType mediaType)
           
static
<T> T
readFromString(javax.ws.rs.ext.Providers providers, java.lang.String input, java.lang.Class<T> type, java.lang.reflect.Type genericType, javax.ws.rs.core.MediaType mediaType)
           
static
<T> T
readFromString(javax.ws.rs.ext.Providers providers, java.lang.String input, java.lang.Class<T> type, java.lang.reflect.Type genericType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders, javax.ws.rs.core.MediaType mediaType)
           
static void writeToStream(java.lang.String string, java.io.OutputStream os, javax.ws.rs.core.MediaType mt)
           
static java.lang.String writeToString(javax.ws.rs.ext.Providers providers, java.lang.Object object, java.lang.Class<?> type, javax.ws.rs.core.MediaType mediaType)
           
static java.lang.String writeToString(javax.ws.rs.ext.Providers providers, java.lang.Object object, java.lang.Class<?> type, java.lang.reflect.Type genericType, javax.ws.rs.core.MediaType mediaType)
           
static java.lang.String writeToString(javax.ws.rs.ext.Providers providers, java.lang.Object object, java.lang.Class<?> type, java.lang.reflect.Type genericType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, javax.ws.rs.core.MediaType mediaType)
           
static java.lang.String writeToString(javax.ws.rs.ext.Providers providers, java.lang.Object object, javax.ws.rs.core.MediaType mediaType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderUtils

public ProviderUtils()
Method Detail

getCharsetOrNull

public static java.lang.String getCharsetOrNull(javax.ws.rs.core.MediaType m)

getCharset

public static java.lang.String getCharset(javax.ws.rs.core.MediaType m)

createReader

public static java.io.Reader createReader(java.io.InputStream stream,
                                          javax.ws.rs.core.MediaType mediaType)

createWriter

public static java.io.Writer createWriter(java.io.OutputStream stream,
                                          javax.ws.rs.core.MediaType mediaType)

readFromStreamAsBytes

public static byte[] readFromStreamAsBytes(java.io.InputStream stream)
                                    throws java.io.IOException
Throws:
java.io.IOException

readFromStreamAsString

public static java.lang.String readFromStreamAsString(java.io.InputStream stream,
                                                      javax.ws.rs.core.MediaType mt)
                                               throws java.io.IOException
Throws:
java.io.IOException

writeToStream

public static void writeToStream(java.lang.String string,
                                 java.io.OutputStream os,
                                 javax.ws.rs.core.MediaType mt)
                          throws java.io.IOException
Throws:
java.io.IOException

copyStream

public static void copyStream(java.io.InputStream src,
                              java.io.OutputStream dst)
                       throws java.io.IOException
Throws:
java.io.IOException

writeToString

public static java.lang.String writeToString(javax.ws.rs.ext.Providers providers,
                                             java.lang.Object object,
                                             javax.ws.rs.core.MediaType mediaType)
                                      throws java.io.IOException
Throws:
java.io.IOException

writeToString

public static java.lang.String writeToString(javax.ws.rs.ext.Providers providers,
                                             java.lang.Object object,
                                             java.lang.Class<?> type,
                                             javax.ws.rs.core.MediaType mediaType)
                                      throws java.io.IOException
Throws:
java.io.IOException

writeToString

public static java.lang.String writeToString(javax.ws.rs.ext.Providers providers,
                                             java.lang.Object object,
                                             java.lang.Class<?> type,
                                             java.lang.reflect.Type genericType,
                                             javax.ws.rs.core.MediaType mediaType)
                                      throws java.io.IOException
Throws:
java.io.IOException

writeToString

public static java.lang.String writeToString(javax.ws.rs.ext.Providers providers,
                                             java.lang.Object object,
                                             java.lang.Class<?> type,
                                             java.lang.reflect.Type genericType,
                                             javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders,
                                             javax.ws.rs.core.MediaType mediaType)
                                      throws java.io.IOException
Throws:
java.io.IOException

readFromString

public static <T> T readFromString(javax.ws.rs.ext.Providers providers,
                                   java.lang.String input,
                                   java.lang.Class<T> type,
                                   javax.ws.rs.core.MediaType mediaType)
                        throws java.io.IOException
Throws:
java.io.IOException

readFromString

public static <T> T readFromString(javax.ws.rs.ext.Providers providers,
                                   java.lang.String input,
                                   java.lang.Class<T> type,
                                   java.lang.reflect.Type genericType,
                                   javax.ws.rs.core.MediaType mediaType)
                        throws java.io.IOException
Throws:
java.io.IOException

readFromString

public static <T> T readFromString(javax.ws.rs.ext.Providers providers,
                                   java.lang.String input,
                                   java.lang.Class<T> type,
                                   java.lang.reflect.Type genericType,
                                   javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders,
                                   javax.ws.rs.core.MediaType mediaType)
                        throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.