public final class RestConnectUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
closeAndRelease(org.mule.runtime.api.streaming.CursorProvider cursorProvider)
Closes the given
cursorProvider and releases all associated resources |
static void |
closeStream(Object stream)
|
static org.mule.runtime.api.metadata.TypedValue<String> |
consumeStringAndClose(Object stream,
org.mule.runtime.api.metadata.MediaType targetMediaType,
Charset targetCharset)
Consumes the contents of the given
stream as a String and closes it. |
static org.mule.runtime.api.metadata.TypedValue<String> |
consumeStringTransformAndClose(Object stream,
Charset sourceCharset,
org.mule.runtime.api.metadata.MediaType targetMediaType,
Charset targetCharset)
Consumes the contents of the given
stream as a String and closes it. |
static boolean |
containsIgnoreCase(String value,
String predicate) |
static boolean |
isBlank(String value) |
static boolean |
isNotBlank(String v) |
static org.mule.metadata.api.model.MetadataType |
loadJsonSchema(String schemaPath,
String schemaContent,
org.mule.metadata.api.model.MetadataFormat metadataFormat) |
static org.mule.metadata.api.model.MetadataType |
loadXmlSchema(String schemaPath,
String schemaContent,
String qName) |
static String |
readSchema(ClassLoader classLoader,
String schemaPath) |
public static void closeAndRelease(org.mule.runtime.api.streaming.CursorProvider cursorProvider)
cursorProvider and releases all associated resourcescursorProvider - a cursor providerpublic static void closeStream(Object stream)
stream which can be either a CursorProvider or an InputStream.
Null values or instances of other classes will be ignored.stream - a streampublic static org.mule.runtime.api.metadata.TypedValue<String> consumeStringAndClose(Object stream, org.mule.runtime.api.metadata.MediaType targetMediaType, Charset targetCharset)
stream as a String and closes it.
The stream can be either a CursorStreamProvider or an InputStream.
IllegalArgumentException will be thrown if the stream is an instance of any other class.
Notice that in the case of CursorStreamProvider, this method will close the provider meaning that it will no longer
be able to yield new cursors.
stream - a CursorStreamProvider or an InputStreamtargetCharset - the encoding to use when reading the String and that will be set to the TypedValuetargetMediaType - the media type that will be set to the TypedValueIllegalArgumentException - if stream is not of the expected types.public static org.mule.runtime.api.metadata.TypedValue<String> consumeStringTransformAndClose(Object stream, Charset sourceCharset, org.mule.runtime.api.metadata.MediaType targetMediaType, Charset targetCharset)
stream as a String and closes it.
The stream can be either a CursorStreamProvider or an InputStream.
IllegalArgumentException will be thrown if the stream is an instance of any other class.
Notice that in the case of CursorStreamProvider, this method will close the provider meaning that it will no longer
be able to yield new cursors.
stream - a CursorStreamProvider or an InputStreamsourceCharset - the encoding to use when reading the StringtargetCharset - the encoding that will be set to the TypedValuetargetMediaType - the media type that will be set to the TypedValueIllegalArgumentException - if stream is not of the expected types.public static boolean isBlank(String value)
public static boolean isNotBlank(String v)
public static String readSchema(ClassLoader classLoader, String schemaPath)
public static org.mule.metadata.api.model.MetadataType loadXmlSchema(String schemaPath, String schemaContent, String qName)
Copyright © 2019. All rights reserved.