From 143d3053dd38704acde71046bde0125999a85915 Mon Sep 17 00:00:00 2001 From: rickle-msft Date: Fri, 3 Jan 2020 14:30:14 -0800 Subject: [PATCH 1/6] Added a package for Java nio implementation --- eng/.docsettings.yml | 1 + eng/jacoco-test-coverage/pom.xml | 5 + eng/spotbugs-aggregate-report/pom.xml | 8 + eng/versioning/version_client.txt | 1 + pom.client.xml | 5 + .../azure-storage-blob-nio/CHANGELOG.md | 10 + sdk/storage/azure-storage-blob-nio/README.md | 215 +++++++++++++ sdk/storage/azure-storage-blob-nio/pom.xml | 282 ++++++++++++++++++ .../azure/storage/blob/nio/package-info.java | 7 + .../src/main/java/module-info.java | 15 + .../java.nio.file.spi.FileSystemProvider | 1 + 11 files changed, 550 insertions(+) create mode 100644 sdk/storage/azure-storage-blob-nio/CHANGELOG.md create mode 100644 sdk/storage/azure-storage-blob-nio/README.md create mode 100644 sdk/storage/azure-storage-blob-nio/pom.xml create mode 100644 sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/package-info.java create mode 100644 sdk/storage/azure-storage-blob-nio/src/main/java/module-info.java create mode 100644 sdk/storage/azure-storage-blob-nio/src/main/resources/META_INF/services/java.nio.file.spi.FileSystemProvider diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index 5b049a71dcf4b..36eec764e767a 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -121,6 +121,7 @@ known_content_issues: - ['sdk/storage/azure-storage-queue/swagger/README.md', '#3113'] - ['sdk/storage/microsoft-azure-storage-blob/README.md', '#3113'] - ['sdk/storage/microsoft-azure-storage-blob/swagger/README.md', '#3113'] + - ['sdk/storage/microsoft-azure-storage-blob-nio/README.md', '#3113'] - ['sdk/storage/README.md', '#3113'] - ['sdk/textanalytics/azure-ai-textanalytics/swagger/README.md', '#3113'] - ['sdk/template/azure-sdk-template/README.md','has other required sections'] diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index e2c8ebc0bd95f..fc8c1a0065ba9 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -132,6 +132,11 @@ azure-storage-blob-cryptography 12.2.0-beta.1 + + com.azure + azure-storage-blob-nio + 12.0.0-preview1 + com.azure azure-storage-file-share diff --git a/eng/spotbugs-aggregate-report/pom.xml b/eng/spotbugs-aggregate-report/pom.xml index 8d076005a4d09..265f7e58e29c7 100644 --- a/eng/spotbugs-aggregate-report/pom.xml +++ b/eng/spotbugs-aggregate-report/pom.xml @@ -67,6 +67,9 @@ ..\..\sdk\storage\azure-storage-blob-batch\src\samples\java\com ..\..\sdk\storage\azure-storage-blob-cryptography\src\main\java\com ..\..\sdk\storage\azure-storage-blob-cryptography\src\samples\java\com + ..\..\sdk\storage\azure-storage-blob-nio\src\main\java\com + ..\..\sdk\storage\azure-storage-blob-nio\src\main\java\com + ..\..\sdk\storage\azure-storage-blob-nio\src\samples\java\com ..\..\sdk\storage\azure-storage-file-share\src\main\java\com ..\..\sdk\storage\azure-storage-file-share\src\samples\java\com ..\..\sdk\storage\azure-storage-file-datalake\src\main\java\com @@ -240,6 +243,11 @@ azure-storage-blob-cryptography 12.2.0-beta.1 + + com.azure + azure-storage-blob-nio + 12.0.0-preview1 + com.azure azure-storage-file-share diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index fc6972cf85f20..e657a09a4e4de 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -25,6 +25,7 @@ com.azure:azure-sdk-template;1.0.4-beta.2;1.0.4-beta.2 com.azure:azure-storage-blob;12.2.0-beta.1;12.2.0-beta.2 com.azure:azure-storage-blob-batch;12.1.0;12.2.0-beta.1 com.azure:azure-storage-blob-cryptography;12.1.0;12.2.0-beta.1 +com.azure:azure-storage-blob-nio;12.0.0-preview1;12.0.0-preview2 com.azure:azure-storage-common;12.2.0-beta.1;12.2.0-beta.2 com.azure:azure-storage-file-share;12.1.0-beta.1;12.1.0-beta.2 com.azure:azure-storage-file-datalake;12.0.0-beta.8;12.0.0-beta.9 diff --git a/pom.client.xml b/pom.client.xml index b16aaaf56573f..fb966de07912d 100644 --- a/pom.client.xml +++ b/pom.client.xml @@ -457,6 +457,10 @@ Azure Storage Blobs - Cryptography com.azure.storage.blob.cryptography* + + Azure Storage Blobs - NIO + com.azure.storage.blob.nio* + Azure Storage - Files com.azure.storage.file* @@ -1238,6 +1242,7 @@ sdk/storage/azure-storage-blob sdk/storage/azure-storage-blob-batch sdk/storage/azure-storage-blob-cryptography + sdk/storage/azure-storage-blob-nio sdk/storage/azure-storage-common sdk/storage/azure-storage-file-share sdk/storage/azure-storage-file-datalake diff --git a/sdk/storage/azure-storage-blob-nio/CHANGELOG.md b/sdk/storage/azure-storage-blob-nio/CHANGELOG.md new file mode 100644 index 0000000000000..c7788da497010 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/CHANGELOG.md @@ -0,0 +1,10 @@ +# Release History + +This package's +[documentation](LINK) +and +[samples](LINK) +demonstrate the new API. + +## 12.0.0-preview.1 (Unreleased) +- Initial Release. Please see the README and wiki for information on the new design. diff --git a/sdk/storage/azure-storage-blob-nio/README.md b/sdk/storage/azure-storage-blob-nio/README.md new file mode 100644 index 0000000000000..73ef2f85f9486 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/README.md @@ -0,0 +1,215 @@ +# Azure Storage Blob client library for Java + + +[Source code][source] | [API reference documentation][docs] | [REST API documentation][rest_docs] | [Product documentation][product_docs] | [Samples][samples] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] +- [Create Storage Account][storage_account] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-storage-blob-nio;current}) +```xml + + com.azure + azure-storage-blob-nio + 12.0.0-preview1 + +``` +[//]: # ({x-version-update-end}) + +### Default HTTP Client +All client libraries, by default, use the Netty HTTP client. Adding the above dependency will automatically configure +Storage Blob to use the Netty HTTP client. + +### Alternate HTTP client +If, instead of Netty it is preferable to use OkHTTP, there is an HTTP client available for that too. Exclude the default +Netty and include the OkHTTP client in your pom.xml. + +[//]: # ({x-version-update-start;com.azure:azure-storage-blob;current}) +```xml + + + com.azure + azure-storage-blob + 12.2.0-beta.2 + + + com.azure + azure-core-http-netty + + + +``` +[//]: # ({x-version-update-end}) +[//]: # ({x-version-update-start;com.azure:azure-core-http-okhttp;current}) +```xml + + + com.azure + azure-core-http-okhttp + 1.1.0 + +``` +[//]: # ({x-version-update-end}) + +### Configuring HTTP Clients +When an HTTP client is included on the classpath, as shown above, it is not necessary to specify it in the client library [builders](#create-blobserviceclient) unless you want to customize the HTTP client in some fashion. If this is desired, the `httpClient` builder method is often available to achieve just this by allowing users to provide custom (or customized) `com.azure.core.http.HttpClient` instances. + +For starters, by having the Netty or OkHTTP dependencies on your classpath, as shown above, you can create new instances of these `HttpClient` types using their builder APIs. For example, here is how you would create a Netty HttpClient instance: + +### Default SSL library +All client libraries, by default, use the Tomcat-native Boring SSL library to enable native-level performance for SSL operations. The Boring SSL library is an uber jar containing native libraries for Linux / macOS / Windows, and provides better performance compared to the default SSL implementation within the JDK. For more information, including how to reduce the dependency size, refer to the [performance tuning][performance_tuning] section of the wiki. + +```java +HttpClient client = new NettyAsyncHttpClientBuilder() + .port(8080) + .wiretap(true) + .build(); +``` + +### Create a Storage Account +To create a Storage Account you can use the [Azure Portal][storage_account_create_portal] or [Azure CLI][storage_account_create_cli]. + +```bash +az storage account create \ + --resource-group \ + --name \ + --location +``` + +### Authenticate the client + +In order to interact with the Storage Service (Blob, Queue, Message, MessageId, File) you'll need to create an instance of the Service Client class. +To make this possible you'll need the Account SAS (shared access signature) string of the Storage Account. Learn more at [SAS Token][sas_token] + +#### Get credentials + +##### SAS Token + +a. Use the Azure CLI snippet below to get the SAS token from the Storage Account. + +```bash +az storage blob generate-sas \ + --account-name {Storage Account name} \ + --container-name {container name} \ + --name {blob name} \ + --permissions {permissions to grant} \ + --expiry {datetime to expire the SAS token} \ + --services {storage services the SAS allows} \ + --resource-types {resource types the SAS allows} +``` + +Example: + +```bash +CONNECTION_STRING= + +az storage blob generate-sas \ + --account-name MyStorageAccount \ + --container-name MyContainer \ + --name MyBlob \ + --permissions racdw \ + --expiry 2020-06-15 +``` + +b. Alternatively, get the Account SAS Token from the Azure Portal. + +1. Go to your Storage Account +2. Select `Shared access signature` from the menu on the left +3. Click on `Generate SAS and connection string` (after setup) + +##### **Shared Key Credential** + +a. Use Account name and Account key. Account name is your Storage Account name. + +1. Go to your Storage Account +2. Select `Access keys` from the menu on the left +3. Under `key1`/`key2` copy the contents of the `Key` field + +or + +b. Use the connection string. + +1. Go to your Storage Account +2. Select `Access keys` from the menu on the left +3. Under `key1`/`key2` copy the contents of the `Connection string` field + +## Key concepts + +Blob Storage is designed for: + +- Serving images or documents directly to a browser +- Storing files for distributed access +- Streaming video and audio +- Writing to log files +- Storing data for backup and restore, disaster recovery, and archiving +- Storing data for analysis by an on-premises or Azure-hosted service + +## Examples + +The following sections provide several code snippets covering some of the most common Azure Storage Blob tasks, including: + +- [Create a `BlobServiceClient`](#create-a-blobserviceclient) + + +### Create a `BlobServiceClient` + +Create a `BlobServiceClient` using the [`sasToken`](#get-credentials) generated above. + +```java +BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() + .endpoint("") + .sasToken("") + .buildClient(); +``` + + +## Troubleshooting + +When interacting with blobs using this Java client library, errors returned by the service correspond to the same HTTP +status codes returned for [REST API][error_codes] requests. For example, if you try to retrieve a container or blob that +doesn't exist in your Storage Account, a `404` error is returned, indicating `Not Found`. + +## Next steps + +Several Storage blob Java SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Key Vault: + +## Next steps Samples +Samples are explained in detail [here][samples_readme]. + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a [Contributor License Agreement (CLA)][cla] declaring that you have the right to, and actually do, grant us the rights to use your contribution. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + +[source]: src +[samples_readme]: src/samples/README.md +[docs]: http://azure.github.io/azure-sdk-for-java/ +[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api +[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity/README.md +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes +[samples]: src/samples +[cla]: https://cla.microsoft.com +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com +[performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob%2FREADME.png) diff --git a/sdk/storage/azure-storage-blob-nio/pom.xml b/sdk/storage/azure-storage-blob-nio/pom.xml new file mode 100644 index 0000000000000..6f2dd49765246 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/pom.xml @@ -0,0 +1,282 @@ + + + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../../pom.client.xml + + + 4.0.0 + + com.azure + azure-storage-blob-nio + 12.0.0-preview1 + + Microsoft Azure implementation of NIO on top of Azure Blob Storage + This module contains an implementation of Java's NIO interface on top of Azure Blob Storage. + https://github.com/Azure/azure-sdk-for-java + + + + azure-java-build-docs + ${site.url}/site/${project.artifactId} + + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + src/main/java + src/test/java + + + + + bintray + Groovy Bintray + https://dl.bintray.com/groovy/maven + + never + + + false + + + + + + + com.azure + azure-storage-blob + 12.2.0-beta.1 + + + org.slf4j + slf4j-api + 1.7.28 + + + + com.azure + azure-core-test + 1.1.0-beta.2 + test + + + com.azure + azure-core-http-netty + 1.1.0 + test + + + com.azure + azure-identity + 1.0.1 + test + + + org.slf4j + slf4j-simple + 1.7.25 + test + + + io.projectreactor + reactor-test + 3.3.0.RELEASE + test + + + com.microsoft.azure + adal4j + 1.6.4 + test + + + org.spockframework + spock-core + 1.3-groovy-2.5 + test + + + cglib + cglib-nodep + 3.2.7 + test + + + + + src/main/java + src/test/java + + + ${basedir}/src/test/resources + + + + + + + java8 + + [1.8,9) + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + true + + -Xlint:all + -Xlint:-serial + -Xlint:-deprecation + -Xlint:-processing + + + module-info.java + + + + + + test-compile + process-test-sources + + testCompile + + + groovy-eclipse-compiler + -warn:-unused + + + + default-testCompile + process-test-sources + + testCompile + + + groovy-eclipse-compiler + -warn:-unused + + + + + + org.codehaus.groovy + groovy-eclipse-compiler + 3.4.0-01 + + + org.codehaus.groovy + groovy-eclipse-batch + 2.5.8-01 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M3 + + + + + + + java9plus + + [9,) + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 9 + 9 + + + + test-compile + process-test-sources + + testCompile + + + groovy-eclipse-compiler + -warn:-unused + 8 + + + + default-testCompile + process-test-sources + + testCompile + + + groovy-eclipse-compiler + -warn:-unused + 8 + + + + + + org.codehaus.groovy + groovy-eclipse-compiler + 3.4.0-01 + + + org.codehaus.groovy + groovy-eclipse-batch + 2.5.8-01 + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M3 + + + --add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED + --add-exports com.azure.core/com.azure.core.implementation.serializer.jackson=ALL-UNNAMED + --add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED + --add-opens com.azure.storage.common/com.azure.storage.common.implementation=ALL-UNNAMED + --add-opens com.azure.storage.common/com.azure.storage.common.sas=ALL-UNNAMED + --add-opens com.azure.storage.blob/com.azure.storage.blob=ALL-UNNAMED + --add-opens com.azure.storage.blob/com.azure.storage.blob.implementation=ALL-UNNAMED + --add-opens com.azure.storage.blob/com.azure.storage.blob.implementation.util=ALL-UNNAMED + --add-opens com.azure.storage.blob/com.azure.storage.blob.specialized=ALL-UNNAMED + --add-reads com.azure.core=ALL-UNNAMED + --add-reads com.azure.core.test=ALL-UNNAMED + --add-reads com.azure.core.amqp=ALL-UNNAMED + --add-reads com.azure.storage.common=ALL-UNNAMED + + + + + + + + diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/package-info.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/package-info.java new file mode 100644 index 0000000000000..4c0df0eab8747 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/package-info.java @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * Package containing the classes for loading the AzureFileSystemProvider. + */ +package com.azure.storage.blob.nio; diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/module-info.java b/sdk/storage/azure-storage-blob-nio/src/main/java/module-info.java new file mode 100644 index 0000000000000..934987e3e13cd --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +module com.azure.storage.blob.cryptography { + requires transitive com.azure.core; + requires transitive com.azure.storage.common; + requires com.azure.storage.blob; + requires com.fasterxml.jackson.dataformat.xml; + + exports com.azure.storage.blob.nio; + + opens com.azure.storage.blob.nio to + com.fasterxml.jackson.databind, + com.azure.core; +} diff --git a/sdk/storage/azure-storage-blob-nio/src/main/resources/META_INF/services/java.nio.file.spi.FileSystemProvider b/sdk/storage/azure-storage-blob-nio/src/main/resources/META_INF/services/java.nio.file.spi.FileSystemProvider new file mode 100644 index 0000000000000..7d26d6d7a2f97 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/main/resources/META_INF/services/java.nio.file.spi.FileSystemProvider @@ -0,0 +1 @@ +main.java.com.azure.storage.nio.blob.AzureFileSystemProvider \ No newline at end of file From e0f078134716e9ed2fac31baa9ec63a60e5361cf Mon Sep 17 00:00:00 2001 From: rickle-msft Date: Fri, 3 Jan 2020 14:35:58 -0800 Subject: [PATCH 2/6] Corrected version number --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/spotbugs-aggregate-report/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/storage/azure-storage-blob-nio/README.md | 2 +- sdk/storage/azure-storage-blob-nio/pom.xml | 2 +- .../azure-storage-blob-nio/src/main/java/module-info.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index fc8c1a0065ba9..286df8dc2f386 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -135,7 +135,7 @@ com.azure azure-storage-blob-nio - 12.0.0-preview1 + 12.0.0-preview.1 com.azure diff --git a/eng/spotbugs-aggregate-report/pom.xml b/eng/spotbugs-aggregate-report/pom.xml index 265f7e58e29c7..154bb87740aeb 100644 --- a/eng/spotbugs-aggregate-report/pom.xml +++ b/eng/spotbugs-aggregate-report/pom.xml @@ -246,7 +246,7 @@ com.azure azure-storage-blob-nio - 12.0.0-preview1 + 12.0.0-preview.1 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e657a09a4e4de..f9025b74f6a9e 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -25,7 +25,7 @@ com.azure:azure-sdk-template;1.0.4-beta.2;1.0.4-beta.2 com.azure:azure-storage-blob;12.2.0-beta.1;12.2.0-beta.2 com.azure:azure-storage-blob-batch;12.1.0;12.2.0-beta.1 com.azure:azure-storage-blob-cryptography;12.1.0;12.2.0-beta.1 -com.azure:azure-storage-blob-nio;12.0.0-preview1;12.0.0-preview2 +com.azure:azure-storage-blob-nio;12.0.0-preview.1;12.0.0-preview.2 com.azure:azure-storage-common;12.2.0-beta.1;12.2.0-beta.2 com.azure:azure-storage-file-share;12.1.0-beta.1;12.1.0-beta.2 com.azure:azure-storage-file-datalake;12.0.0-beta.8;12.0.0-beta.9 diff --git a/sdk/storage/azure-storage-blob-nio/README.md b/sdk/storage/azure-storage-blob-nio/README.md index 73ef2f85f9486..73202aea23529 100644 --- a/sdk/storage/azure-storage-blob-nio/README.md +++ b/sdk/storage/azure-storage-blob-nio/README.md @@ -18,7 +18,7 @@ com.azure azure-storage-blob-nio - 12.0.0-preview1 + 12.0.0-preview.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storage/azure-storage-blob-nio/pom.xml b/sdk/storage/azure-storage-blob-nio/pom.xml index 6f2dd49765246..a6f7c01cd42a1 100644 --- a/sdk/storage/azure-storage-blob-nio/pom.xml +++ b/sdk/storage/azure-storage-blob-nio/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-blob-nio - 12.0.0-preview1 + 12.0.0-preview.1 Microsoft Azure implementation of NIO on top of Azure Blob Storage This module contains an implementation of Java's NIO interface on top of Azure Blob Storage. diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/module-info.java b/sdk/storage/azure-storage-blob-nio/src/main/java/module-info.java index 934987e3e13cd..58d95ad8f3060 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/module-info.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/module-info.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -module com.azure.storage.blob.cryptography { +module com.azure.storage.blob.nio { requires transitive com.azure.core; requires transitive com.azure.storage.common; requires com.azure.storage.blob; From 5bd60180c5715bbe5779fa2be2a774d5086ae0af Mon Sep 17 00:00:00 2001 From: rickle-msft Date: Fri, 3 Jan 2020 14:38:31 -0800 Subject: [PATCH 3/6] cleanup --- eng/spotbugs-aggregate-report/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/spotbugs-aggregate-report/pom.xml b/eng/spotbugs-aggregate-report/pom.xml index 154bb87740aeb..c88525fbe4c7f 100644 --- a/eng/spotbugs-aggregate-report/pom.xml +++ b/eng/spotbugs-aggregate-report/pom.xml @@ -68,7 +68,6 @@ ..\..\sdk\storage\azure-storage-blob-cryptography\src\main\java\com ..\..\sdk\storage\azure-storage-blob-cryptography\src\samples\java\com ..\..\sdk\storage\azure-storage-blob-nio\src\main\java\com - ..\..\sdk\storage\azure-storage-blob-nio\src\main\java\com ..\..\sdk\storage\azure-storage-blob-nio\src\samples\java\com ..\..\sdk\storage\azure-storage-file-share\src\main\java\com ..\..\sdk\storage\azure-storage-file-share\src\samples\java\com From fb9494e14d93e14c9878d4f413245d42fc54c0ff Mon Sep 17 00:00:00 2001 From: rickle-msft Date: Fri, 3 Jan 2020 15:00:44 -0800 Subject: [PATCH 4/6] PR feedback --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/spotbugs-aggregate-report/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/storage/azure-storage-blob-nio/CHANGELOG.md | 2 +- sdk/storage/azure-storage-blob-nio/README.md | 6 +++--- sdk/storage/azure-storage-blob-nio/pom.xml | 15 +-------------- .../com/azure/storage/blob/nio/package-info.java | 2 +- 7 files changed, 9 insertions(+), 22 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 286df8dc2f386..ba4132fbd4e7e 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -135,7 +135,7 @@ com.azure azure-storage-blob-nio - 12.0.0-preview.1 + 12.0.0-beta.1 com.azure diff --git a/eng/spotbugs-aggregate-report/pom.xml b/eng/spotbugs-aggregate-report/pom.xml index c88525fbe4c7f..96b1dce227959 100644 --- a/eng/spotbugs-aggregate-report/pom.xml +++ b/eng/spotbugs-aggregate-report/pom.xml @@ -245,7 +245,7 @@ com.azure azure-storage-blob-nio - 12.0.0-preview.1 + 12.0.0-beta.1 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f9025b74f6a9e..532c37545d12b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -25,7 +25,7 @@ com.azure:azure-sdk-template;1.0.4-beta.2;1.0.4-beta.2 com.azure:azure-storage-blob;12.2.0-beta.1;12.2.0-beta.2 com.azure:azure-storage-blob-batch;12.1.0;12.2.0-beta.1 com.azure:azure-storage-blob-cryptography;12.1.0;12.2.0-beta.1 -com.azure:azure-storage-blob-nio;12.0.0-preview.1;12.0.0-preview.2 +com.azure:azure-storage-blob-nio;12.0.0-beta.1;12.0.0-beta.1 com.azure:azure-storage-common;12.2.0-beta.1;12.2.0-beta.2 com.azure:azure-storage-file-share;12.1.0-beta.1;12.1.0-beta.2 com.azure:azure-storage-file-datalake;12.0.0-beta.8;12.0.0-beta.9 diff --git a/sdk/storage/azure-storage-blob-nio/CHANGELOG.md b/sdk/storage/azure-storage-blob-nio/CHANGELOG.md index c7788da497010..972764e38a67d 100644 --- a/sdk/storage/azure-storage-blob-nio/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob-nio/CHANGELOG.md @@ -6,5 +6,5 @@ and [samples](LINK) demonstrate the new API. -## 12.0.0-preview.1 (Unreleased) +## 12.0.0-beta.1 (Unreleased) - Initial Release. Please see the README and wiki for information on the new design. diff --git a/sdk/storage/azure-storage-blob-nio/README.md b/sdk/storage/azure-storage-blob-nio/README.md index 73202aea23529..870343ccd6590 100644 --- a/sdk/storage/azure-storage-blob-nio/README.md +++ b/sdk/storage/azure-storage-blob-nio/README.md @@ -1,5 +1,5 @@ -# Azure Storage Blob client library for Java - +# Azure Storage Blob implementation of Java NIO +## This README is not yet updated for this project and is a skeleton copied from blobs [Source code][source] | [API reference documentation][docs] | [REST API documentation][rest_docs] | [Product documentation][product_docs] | [Samples][samples] @@ -18,7 +18,7 @@ com.azure azure-storage-blob-nio - 12.0.0-preview.1 + 12.0.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storage/azure-storage-blob-nio/pom.xml b/sdk/storage/azure-storage-blob-nio/pom.xml index a6f7c01cd42a1..c7df33047ee55 100644 --- a/sdk/storage/azure-storage-blob-nio/pom.xml +++ b/sdk/storage/azure-storage-blob-nio/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-blob-nio - 12.0.0-preview.1 + 12.0.0-beta.1 Microsoft Azure implementation of NIO on top of Azure Blob Storage This module contains an implementation of Java's NIO interface on top of Azure Blob Storage. @@ -259,19 +259,6 @@ 3.0.0-M3 - --add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED - --add-exports com.azure.core/com.azure.core.implementation.serializer.jackson=ALL-UNNAMED - --add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED - --add-opens com.azure.storage.common/com.azure.storage.common.implementation=ALL-UNNAMED - --add-opens com.azure.storage.common/com.azure.storage.common.sas=ALL-UNNAMED - --add-opens com.azure.storage.blob/com.azure.storage.blob=ALL-UNNAMED - --add-opens com.azure.storage.blob/com.azure.storage.blob.implementation=ALL-UNNAMED - --add-opens com.azure.storage.blob/com.azure.storage.blob.implementation.util=ALL-UNNAMED - --add-opens com.azure.storage.blob/com.azure.storage.blob.specialized=ALL-UNNAMED - --add-reads com.azure.core=ALL-UNNAMED - --add-reads com.azure.core.test=ALL-UNNAMED - --add-reads com.azure.core.amqp=ALL-UNNAMED - --add-reads com.azure.storage.common=ALL-UNNAMED diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/package-info.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/package-info.java index 4c0df0eab8747..96cd1fbd62756 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/package-info.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Package containing the classes for loading the AzureFileSystemProvider. + * Package containing the classes for loading the AzureFileSystemProvider based on Azure Storage Blobs. */ package com.azure.storage.blob.nio; From 2ae4daf187eb7387e4cf0eb285198660bdcbbed7 Mon Sep 17 00:00:00 2001 From: rickle-msft Date: Fri, 3 Jan 2020 15:25:04 -0800 Subject: [PATCH 5/6] docsettings and empty class for compiling --- eng/.docsettings.yml | 2 +- .../blob/nio/AzureFileSystemProvider.java | 98 +++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index 36eec764e767a..690ec90b26cfb 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -121,7 +121,7 @@ known_content_issues: - ['sdk/storage/azure-storage-queue/swagger/README.md', '#3113'] - ['sdk/storage/microsoft-azure-storage-blob/README.md', '#3113'] - ['sdk/storage/microsoft-azure-storage-blob/swagger/README.md', '#3113'] - - ['sdk/storage/microsoft-azure-storage-blob-nio/README.md', '#3113'] + - ['sdk/storage/azure-storage-blob-nio/README.md', '#3113'] - ['sdk/storage/README.md', '#3113'] - ['sdk/textanalytics/azure-ai-textanalytics/swagger/README.md', '#3113'] - ['sdk/template/azure-sdk-template/README.md','has other required sections'] diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java new file mode 100644 index 0000000000000..1fd615d71a43f --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.nio; + +import java.io.IOException; +import java.net.URI; +import java.nio.channels.SeekableByteChannel; +import java.nio.file.AccessMode; +import java.nio.file.CopyOption; +import java.nio.file.DirectoryStream; +import java.nio.file.FileStore; +import java.nio.file.FileSystem; +import java.nio.file.LinkOption; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.FileAttributeView; +import java.nio.file.spi.FileSystemProvider; +import java.util.Map; +import java.util.Set; + +public class AzureFileSystemProvider extends FileSystemProvider { + + public String getScheme() { + return null; + } + + public FileSystem newFileSystem(URI uri, Map config) throws IOException { + return null; + } + + public FileSystem getFileSystem(URI uri) { + return null; + } + + public Path getPath(URI uri) { + return getFileSystem(uri).getPath(uri.getPath()); + } + + public SeekableByteChannel newByteChannel(Path path, Set set, + FileAttribute... fileAttributes) throws IOException { + return null; + } + + public DirectoryStream newDirectoryStream(Path path, DirectoryStream.Filter filter) throws IOException { + return null; + } + + public void createDirectory(Path path, FileAttribute... fileAttributes) throws IOException { + + } + + public void delete(Path path) throws IOException { + + } + + public void copy(Path path, Path path1, CopyOption... copyOptions) throws IOException { + + } + + public void move(Path path, Path path1, CopyOption... copyOptions) throws IOException { + + } + + public boolean isSameFile(Path path, Path path1) throws IOException { + return false; + } + + public boolean isHidden(Path path) throws IOException { + return false; + } + + public FileStore getFileStore(Path path) throws IOException { + return null; + } + + public void checkAccess(Path path, AccessMode... accessModes) throws IOException { + + } + + public V getFileAttributeView(Path path, Class aClass, LinkOption... linkOptions) { + return null; + } + + public A readAttributes(Path path, Class aClass, LinkOption... linkOptions) throws IOException { + return null; + } + + public Map readAttributes(Path path, String s, LinkOption... linkOptions) throws IOException { + return null; + } + + public void setAttribute(Path path, String s, Object o, LinkOption... linkOptions) throws IOException { + + } +} From fcc8f2fdbb3ab786eca0d09d09462c724ff82b9b Mon Sep 17 00:00:00 2001 From: rickle-msft Date: Fri, 3 Jan 2020 16:03:47 -0800 Subject: [PATCH 6/6] Javadocs --- .../blob/nio/AzureFileSystemProvider.java | 95 +------------------ 1 file changed, 4 insertions(+), 91 deletions(-) diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java index 1fd615d71a43f..72e5dd611c694 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java @@ -3,96 +3,9 @@ package com.azure.storage.blob.nio; -import java.io.IOException; -import java.net.URI; -import java.nio.channels.SeekableByteChannel; -import java.nio.file.AccessMode; -import java.nio.file.CopyOption; -import java.nio.file.DirectoryStream; -import java.nio.file.FileStore; -import java.nio.file.FileSystem; -import java.nio.file.LinkOption; -import java.nio.file.OpenOption; -import java.nio.file.Path; -import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.FileAttribute; -import java.nio.file.attribute.FileAttributeView; -import java.nio.file.spi.FileSystemProvider; -import java.util.Map; -import java.util.Set; +/** + * Empty class. + */ +public class AzureFileSystemProvider { -public class AzureFileSystemProvider extends FileSystemProvider { - - public String getScheme() { - return null; - } - - public FileSystem newFileSystem(URI uri, Map config) throws IOException { - return null; - } - - public FileSystem getFileSystem(URI uri) { - return null; - } - - public Path getPath(URI uri) { - return getFileSystem(uri).getPath(uri.getPath()); - } - - public SeekableByteChannel newByteChannel(Path path, Set set, - FileAttribute... fileAttributes) throws IOException { - return null; - } - - public DirectoryStream newDirectoryStream(Path path, DirectoryStream.Filter filter) throws IOException { - return null; - } - - public void createDirectory(Path path, FileAttribute... fileAttributes) throws IOException { - - } - - public void delete(Path path) throws IOException { - - } - - public void copy(Path path, Path path1, CopyOption... copyOptions) throws IOException { - - } - - public void move(Path path, Path path1, CopyOption... copyOptions) throws IOException { - - } - - public boolean isSameFile(Path path, Path path1) throws IOException { - return false; - } - - public boolean isHidden(Path path) throws IOException { - return false; - } - - public FileStore getFileStore(Path path) throws IOException { - return null; - } - - public void checkAccess(Path path, AccessMode... accessModes) throws IOException { - - } - - public V getFileAttributeView(Path path, Class aClass, LinkOption... linkOptions) { - return null; - } - - public A readAttributes(Path path, Class aClass, LinkOption... linkOptions) throws IOException { - return null; - } - - public Map readAttributes(Path path, String s, LinkOption... linkOptions) throws IOException { - return null; - } - - public void setAttribute(Path path, String s, Object o, LinkOption... linkOptions) throws IOException { - - } }