/** * Gets the share URI from a file address * * @param fileAddress * the file address * @param usePathStyleUris * a value indicating if the address is a path style uri. * @return the share URI from a file address * @throws URISyntaxException */ public static StorageUri getShareURI(final StorageUri fileAddress, final boolean usePathStyleUris) throws URISyntaxException { final String shareName = getShareNameFromUri(fileAddress.getPrimaryUri(), usePathStyleUris); final StorageUri shareUri = appendPathToUri(getServiceClientBaseAddress(fileAddress, usePathStyleUris), shareName); return shareUri; }
/** * Gets the share URI from a file address * * @param fileAddress * the file address * @param usePathStyleUris * a value indicating if the address is a path style uri. * @return the share URI from a file address * @throws URISyntaxException */ public static StorageUri getShareURI(final StorageUri fileAddress, final boolean usePathStyleUris) throws URISyntaxException { final String shareName = getShareNameFromUri(fileAddress.getPrimaryUri(), usePathStyleUris); final StorageUri shareUri = appendPathToUri(getServiceClientBaseAddress(fileAddress, usePathStyleUris), shareName); return shareUri; }
/** * Returns the share for this directory. * * @return A {@link CloudFileShare} that represents the share for this directory. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException * If the resource URI is invalid. */ @Override public CloudFileShare getShare() throws StorageException, URISyntaxException { if (this.share == null) { this.share = this.fileServiceClient.getShareReference(PathUtility.getShareNameFromUri(this.getUri(), this.fileServiceClient.isUsePathStyleUris())); } return this.share; }
/** * Returns the share for this directory. * * @return A {@link CloudFileShare} that represents the share for this directory. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException * If the resource URI is invalid. */ @Override public CloudFileShare getShare() throws StorageException, URISyntaxException { if (this.share == null) { this.share = this.fileServiceClient.getShareReference(PathUtility.getShareNameFromUri(this.getUri(), this.fileServiceClient.isUsePathStyleUris())); } return this.share; }
this.fileServiceClient = new CloudFileClient(PathUtility.getServiceClientBaseAddress( this.getStorageUri(), usePathStyleUris), credentials != null ? credentials : parsedCredentials); this.name = PathUtility.getShareNameFromUri(this.storageUri.getPrimaryUri(), usePathStyleUris);
this.fileServiceClient = new CloudFileClient(PathUtility.getServiceClientBaseAddress( this.getStorageUri(), usePathStyleUris), credentials != null ? credentials : parsedCredentials); this.name = PathUtility.getShareNameFromUri(this.storageUri.getPrimaryUri(), usePathStyleUris);