public final class PathUtility extends Object
| Modifier and Type | Method and Description |
|---|---|
static StorageUri |
addToQuery(StorageUri resourceURI,
String queryString)
Adds a queryString to an URI.
|
static URI |
addToQuery(URI resourceURI,
String queryString)
Adds a queryString to an URI.
|
static URI |
addToSingleUriQuery(URI resourceURI,
HashMap<String,String[]> fieldCollection)
Adds a queryString to an URI.
|
static URI |
appendPathToSingleUri(URI uri,
String relativeOrAbsoluteUri)
Appends a path to a URI correctly using "/" as separator.
|
static URI |
appendPathToSingleUri(URI uri,
String relativeUri,
String separator)
Appends a path to a URI correctly using the given separator.
|
static StorageUri |
appendPathToUri(StorageUri uriList,
String relativeOrAbsoluteUri)
Appends a path to a list of URIs correctly using "/" as separator.
|
static StorageUri |
appendPathToUri(StorageUri uriList,
String relativeOrAbsoluteUri,
String separator)
Appends a path to a list of URIs correctly using "/" as separator.
|
static String |
getBlobNameFromURI(URI inURI,
boolean usePathStyleUris)
Gets the blob name from the URI.
|
static String |
getCanonicalPathFromCredentials(StorageCredentials credentials,
String absolutePath)
Gets the canonical path for an object from the credentials.
|
static String |
getContainerNameFromUri(URI resourceAddress,
boolean usePathStyleUris)
Get the container name from address from the URI.
|
static StorageUri |
getContainerURI(StorageUri blobAddress,
boolean usePathStyleUris)
Gets the container URI from a blob address
|
static String |
getDirectoryNameFromURI(URI resourceAddress,
boolean usePathStyleUris)
Get the name of the lowest level directory from the given directory address.
|
static String |
getFileNameFromURI(URI resourceAddress,
boolean usePathStyleUris)
Gets the file name from the URI.
|
static StorageUri |
getServiceClientBaseAddress(StorageUri addressUri,
boolean usePathStyleUris)
Get the service client address from a complete Uri.
|
static String |
getServiceClientBaseAddress(URI address,
boolean usePathStyleUris)
Get the service client address from a complete Uri.
|
static String |
getShareNameFromUri(URI resourceAddress,
boolean usePathStyleUris)
Get the share name from address from the URI.
|
static StorageUri |
getShareURI(StorageUri fileAddress,
boolean usePathStyleUris)
Gets the share URI from a file address
|
static String |
getTableNameFromUri(URI resourceAddress,
boolean usePathStyleUris)
Get the table name from address from the URI.
|
static HashMap<String,String[]> |
parseQueryString(String parseString)
Parses a query string into a one to many hashmap.
|
static URI |
stripSingleURIQueryAndFragment(URI inUri)
Strips the Query and Fragment from the uri.
|
static StorageUri |
stripURIQueryAndFragment(StorageUri inUri)
Strips the Query and Fragment from the uri.
|
public static URI addToSingleUriQuery(URI resourceURI, HashMap<String,String[]> fieldCollection) throws URISyntaxException, StorageException
resourceURI - the URI of the resourcefieldCollection - the key/ values collection to append.URISyntaxException - if the resulting URI is invalid.StorageExceptionpublic static StorageUri addToQuery(StorageUri resourceURI, String queryString) throws URISyntaxException, StorageException
resourceURI - the URI of the resourcequeryString - the query string to addURISyntaxException - if the resulting URI is invalid.StorageExceptionpublic static URI addToQuery(URI resourceURI, String queryString) throws URISyntaxException, StorageException
resourceURI - the URI of the resourcequeryString - the query string to addURISyntaxException - if the resulting URI is invalid.StorageExceptionpublic static StorageUri appendPathToUri(StorageUri uriList, String relativeOrAbsoluteUri) throws URISyntaxException
uriList - The base Uri.relativeOrAbslouteUri - The relative or absloute URI.URISyntaxExceptionpublic static StorageUri appendPathToUri(StorageUri uriList, String relativeOrAbsoluteUri, String separator) throws URISyntaxException
uriList - The base Uri.relativeOrAbslouteUri - The relative or absloute URI.URISyntaxExceptionpublic static URI appendPathToSingleUri(URI uri, String relativeOrAbsoluteUri) throws URISyntaxException
uriList - The base Uri.relativeOrAbslouteUri - The relative or absloute URI.URISyntaxExceptionpublic static URI appendPathToSingleUri(URI uri, String relativeUri, String separator) throws URISyntaxException
uri - The base Uri.relativeUri - The relative URI.separator - the separator to use.URISyntaxException - a valid Uri cannot be constructedpublic static String getBlobNameFromURI(URI inURI, boolean usePathStyleUris) throws URISyntaxException
inURI - the resource addressusePathStyleUris - a value indicating if the address is a path style uri.URISyntaxExceptionpublic static String getCanonicalPathFromCredentials(StorageCredentials credentials, String absolutePath)
credentials - the credentials to use.absolutePath - the Absolute path of the object.public static String getContainerNameFromUri(URI resourceAddress, boolean usePathStyleUris)
resourceAddress - The container Uri.usePathStyleUris - a value indicating if the address is a path style uri.IllegalArgumentExceptionpublic static String getFileNameFromURI(URI resourceAddress, boolean usePathStyleUris)
resourceAddress - the file URIusePathStyleUris - a value indicating if the address is a path style URIpublic static String getDirectoryNameFromURI(URI resourceAddress, boolean usePathStyleUris)
resourceAddress - the directory URIusePathStyleUris - a value indicating if the address is a path style URIpublic static String getShareNameFromUri(URI resourceAddress, boolean usePathStyleUris)
resourceAddress - The share Uri.usePathStyleUris - a value indicating if the address is a path style uri.IllegalArgumentExceptionpublic static String getTableNameFromUri(URI resourceAddress, boolean usePathStyleUris)
resourceAddress - The table Uri.usePathStyleUris - a value indicating if the address is a path style uri.IllegalArgumentExceptionpublic static StorageUri getContainerURI(StorageUri blobAddress, boolean usePathStyleUris) throws URISyntaxException
blobAddress - the blob addressusePathStyleUris - a value indicating if the address is a path style uri.URISyntaxExceptionpublic static StorageUri getShareURI(StorageUri fileAddress, boolean usePathStyleUris) throws URISyntaxException
fileAddress - the file addressusePathStyleUris - a value indicating if the address is a path style uri.URISyntaxExceptionpublic static String getServiceClientBaseAddress(URI address, boolean usePathStyleUris) throws URISyntaxException
address - Complete address of the resource.usePathStyleUris - a value indicating if the address is a path style uri.URISyntaxExceptionpublic static StorageUri getServiceClientBaseAddress(StorageUri addressUri, boolean usePathStyleUris) throws URISyntaxException
address - Complete address of the resource.usePathStyleUris - a value indicating if the address is a path style uri.URISyntaxExceptionpublic static HashMap<String,String[]> parseQueryString(String parseString) throws StorageException
parseString - the string to parseStorageExceptionpublic static URI stripSingleURIQueryAndFragment(URI inUri) throws StorageException
inUri - the uri to alterStorageExceptionpublic static StorageUri stripURIQueryAndFragment(StorageUri inUri) throws StorageException
inUri - the uri to alterStorageExceptionCopyright © 2019. All rights reserved.