Utility Class
- java.
lang. Object - com.
azure. storage. common. Utility
- com.
public final class Utility
Utility methods for storage client libraries.
Field Summary
Modifier and Type | Field and Description |
---|---|
static final String |
STORAGE_TRACING_NAMESPACE_VALUE
Please see here for more information on Azure resource provider namespaces. |
Constructor Summary
Constructor | Description |
---|---|
Utility() |
Creates a new instance of Utility. |
Method Summary
Modifier and Type | Method and Description |
---|---|
static String |
appendQueryParameter(String url, String key, String value)
Appends a query parameter to a url. |
static
Flux<Byte |
convertStreamToByteBuffer(InputStream data, long length, int blockSize)
A utility method for converting the input stream to Flux of Byte |
static
Flux<Byte |
convertStreamToByteBuffer(InputStream data, long length, int blockSize, boolean markAndReset)
A utility method for converting the input stream to Flux of Byte |
static String |
encodeUrlPath(String url)
Performs a safe encoding of a url string, only encoding the path. |
static
Offset |
parseDate(String dateString)
Deprecated
Use StorageImplUtils#parseDateAndFormat(String)
Given a String representing a date in a form of the ISO8601 pattern, generates a Date representing it with up to millisecond precision. |
static String |
urlDecode(String stringToDecode)
Performs a safe decoding of the passed string, taking care to preserve each |
static String |
urlEncode(String stringToEncode)
Performs a safe encoding of the specified string, taking care to insert %20 for each space character instead of inserting the |
Methods inherited from java.lang.Object
Field Details
STORAGE_TRACING_NAMESPACE_VALUE
public static final String STORAGE_TRACING_NAMESPACE_VALUE
Please see here for more information on Azure resource provider namespaces.
Constructor Details
Utility
public Utility()
Creates a new instance of Utility.
Method Details
appendQueryParameter
public static String appendQueryParameter(String url, String key, String value)
Appends a query parameter to a url.
Parameters:
Returns:
convertStreamToByteBuffer
public static Flux
A utility method for converting the input stream to Flux of ByteBuffer. Will check the equality of entity length and the input length.
Parameters:
Returns:
convertStreamToByteBuffer
public static Flux
A utility method for converting the input stream to Flux of ByteBuffer. Will check the equality of entity length and the input length.
Using markAndReset=true to force a seekable stream implies a buffering strategy is not being used, in which case length is still needed for whatever underlying REST call is being streamed to. If markAndReset=false and data is being buffered, consider using com.azure.core.util.FluxUtil#toFluxByteBuffer(InputStream, int) which does not require a data length.
Parameters:
Returns:
encodeUrlPath
public static String encodeUrlPath(String url)
Performs a safe encoding of a url string, only encoding the path.
Parameters:
Returns:
parseDate
@Deprecated
public static OffsetDateTime parseDate(String dateString)
Deprecated
Given a String representing a date in a form of the ISO8601 pattern, generates a Date representing it with up to millisecond precision.
Parameters:
String
to be interpreted as a Date
Returns:
Date
objecturlDecode
public static String urlDecode(String stringToDecode)
Performs a safe decoding of the passed string, taking care to preserve each +
character rather than replacing it with a space character.
Parameters:
Returns:
urlEncode
public static String urlEncode(String stringToEncode)
Performs a safe encoding of the specified string, taking care to insert %20 for each space character instead of inserting the +
character.
Parameters:
Returns:
Applies to
Azure SDK for Java