Class ProviderHelper


  • public final class ProviderHelper
    extends Object
    A utility class to provide supporting functionality to various entity providers.
    Version:
    $Revision: $
    Author:
    Ryan J. McDonough
    • Method Detail

      • readString

        public static String readString​(InputStream in,
                                        javax.ws.rs.core.MediaType mediaType)
                                 throws IOException
        Parameters:
        in - input stream
        mediaType - media type
        Returns:
        string data
        Throws:
        IOException - if I/O error occurred
      • getAvailableMediaTypes

        public static List<javax.ws.rs.core.MediaType> getAvailableMediaTypes​(String[] mediaTypes)
        Parameters:
        mediaTypes - string array of media types
        Returns:
        list of media types
      • getAvailableVariants

        public static List<javax.ws.rs.core.Variant> getAvailableVariants​(String[] mediaTypes)
        Parameters:
        mediaTypes - string array of media types
        Returns:
        list of Variant
      • getAvailableVariants

        public static List<javax.ws.rs.core.Variant> getAvailableVariants​(List<javax.ws.rs.core.MediaType> mediaTypes)
        Parameters:
        mediaTypes - list of media types
        Returns:
        list of Variant
      • asyncRead

        public static int asyncRead​(InputStream in,
                                    byte[] buf)
      • asyncRead

        public static int asyncRead​(InputStream in,
                                    byte[] buf,
                                    int offset,
                                    int length)