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 |
getFileNameFromURI(URI inURI,
boolean usePathStyleUris)
Gets the file name from the URI.
|
static String |
getQueueNameFromUri(URI resourceAddress,
boolean usePathStyleUris)
Get the queue name from address 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 inURI, boolean usePathStyleUris)
inURI - the resource addressusePathStyleUris - a value indicating if the address is a path style uri.public 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 getQueueNameFromUri(URI resourceAddress, boolean usePathStyleUris)
resourceAddress - The queue Uri.usePathStyleUris - a value indicating if the address is a path style uri.IllegalArgumentExceptionpublic 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 alterStorageException/**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/