/**
   * Strips the query and verifies the URI is absolute.
   *
   * @param completeUri A {@link StorageUri} object which represents the complete URI.
   * @param existingClient A {@link CloudFileClient} object which represents the client to use.
   * @param usePathStyleUris <code>true</code> if path-style URIs are used; otherwise, <code>false
   *     </code>.
   * @throws StorageException If a storage service error occurred.
   * @throws URISyntaxException
   */
  private void parseQueryAndVerify(
      final StorageUri completeUri,
      final CloudFileClient existingClient,
      final boolean usePathStyleUri)
      throws StorageException, URISyntaxException {
    Utility.assertNotNull("completeUri", completeUri);

    if (!completeUri.isAbsolute()) {
      final String errorMessage =
          String.format(SR.RELATIVE_ADDRESS_NOT_PERMITTED, completeUri.toString());
      throw new IllegalArgumentException(errorMessage);
    }

    this.storageUri = PathUtility.stripURIQueryAndFragment(completeUri);
    this.fileServiceClient =
        (existingClient == null)
            ? new CloudFileClient(
                PathUtility.getServiceClientBaseAddress(this.storageUri, usePathStyleUri), null)
            : existingClient;
    this.name = PathUtility.getFileNameFromURI(completeUri.getPrimaryUri(), usePathStyleUri);
  }