Module com.gluonhq.cloudlink.client
Class RestDataSourceUtil
- java.lang.Object
-
- com.gluonhq.impl.cloudlink.client.data.util.RestDataSourceUtil
-
public class RestDataSourceUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description RestDataSourceUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RestClientcreateBasicRestClient(String observableIdentifier, RemoteFunction remoteFunction, CloudLinkConfiguration cloudLinkConfiguration)static RestClientcreateMultipartRestClient(String observableIdentifier, RemoteFunction remoteFunction, CloudLinkConfiguration cloudLinkConfiguration)static RestClientcreateRestClient(String observableIdentifier, RemoteFunction remoteFunction, CloudLinkConfiguration cloudLinkConfiguration)static StringgetContentType(RestDataSource restDataSource)Returns the first Content-Type response header from the rest data source.static <T> InputStreamInputConverter<T>getConverter(Class<T> targetClass, RestDataSource restDataSource)static <T> InputStreamInputConverter<T>getConverter(Class<T> targetClass, String converterType)static <T> StringgetConverterType(Class<T> targetClass, RestDataSource restDataSource)static <E> InputStreamIterableInputConverter<E>getIterableConverter(Class<E> targetClass, RestDataSource restDataSource)static <E> InputStreamIterableInputConverter<E>getIterableConverter(Class<E> targetClass, String converterType)static StringgetIterableConverterType(RestDataSource restDataSource)static InputStreamreadLocalFile(String functionName)
-
-
-
Method Detail
-
getContentType
public static String getContentType(RestDataSource restDataSource)
Returns the first Content-Type response header from the rest data source. The value of the content type can benullwhen the response header is not provided by the HTTP response. Note that the methodRestDataSource.getInputStream()should already be called before calling this method.- Returns:
- the Content-Type response header or
nullif the response header is not provided
-
getConverter
public static <T> InputStreamInputConverter<T> getConverter(Class<T> targetClass, String converterType)
-
getConverter
public static <T> InputStreamInputConverter<T> getConverter(Class<T> targetClass, RestDataSource restDataSource)
-
getConverterType
public static <T> String getConverterType(Class<T> targetClass, RestDataSource restDataSource)
-
getIterableConverter
public static <E> InputStreamIterableInputConverter<E> getIterableConverter(Class<E> targetClass, String converterType)
-
getIterableConverter
public static <E> InputStreamIterableInputConverter<E> getIterableConverter(Class<E> targetClass, RestDataSource restDataSource)
-
getIterableConverterType
public static String getIterableConverterType(RestDataSource restDataSource)
-
createRestClient
public static RestClient createRestClient(String observableIdentifier, RemoteFunction remoteFunction, CloudLinkConfiguration cloudLinkConfiguration)
-
createBasicRestClient
public static RestClient createBasicRestClient(String observableIdentifier, RemoteFunction remoteFunction, CloudLinkConfiguration cloudLinkConfiguration)
-
createMultipartRestClient
public static RestClient createMultipartRestClient(String observableIdentifier, RemoteFunction remoteFunction, CloudLinkConfiguration cloudLinkConfiguration)
-
readLocalFile
public static InputStream readLocalFile(String functionName)
-
-