From 9161493b0ef0d22de76e24d54c0a1ac32722f0a9 Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Mon, 27 Jan 2020 14:12:19 -0800 Subject: [PATCH 1/7] Updated to use embedme in blob --- sdk/storage/azure-storage-blob/README.md | 68 ++++++---- .../com/azure/storage/blob/ReadmeSamples.java | 125 ++++++++++++++++++ 2 files changed, 168 insertions(+), 25 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ReadmeSamples.java diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index 5a23100d1ff0..ae4850c3015d 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -124,51 +124,57 @@ The following sections provide several code snippets covering some of the most c Create a `BlobServiceClient` using the [`sasToken`](#get-credentials) generated above. + ```java BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() - .endpoint("") - .sasToken("") - .buildClient(); + .endpoint("") + .sasToken("") + .buildClient(); ``` or + ```java BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() - .endpoint("" + "?" + "") - .buildClient(); + .endpoint("" + "?" + "") + .buildClient(); ``` ### Create a `BlobContainerClient` Create a `BlobContainerClient` using a `BlobServiceClient`. + ```java BlobContainerClient blobContainerClient = blobServiceClient.getBlobContainerClient("mycontainer"); ``` Create a `BlobContainerClient` from the builder [`sasToken`](#get-credentials) generated above. + ```java BlobContainerClient blobContainerClient = new BlobContainerClientBuilder() - .endpoint("") - .sasToken("") - .containerName("mycontainer") - .buildClient(); + .endpoint("") + .sasToken("") + .containerName("mycontainer") + .buildClient(); ``` or + ```java BlobContainerClient blobContainerClient = new BlobContainerClientBuilder() - .endpoint("" + "/" + "mycontainer" + "?" + "") - .buildClient(); + .endpoint("" + "/" + "mycontainer" + "?" + "") + .buildClient(); ``` ### Create a `BlobClient` Create a `BlobClient` using a `BlobContainerClient`. + ```java BlobClient blobClient = blobContainerClient.getBlobClient("myblob"); ``` @@ -177,27 +183,30 @@ or Create a `BlobClient` from the builder [`sasToken`](#get-credentials) generated above. + ```java BlobClient blobClient = new BlobClientBuilder() - .endpoint("") - .sasToken("") - .containerName("mycontainer") - .blobName("myblob") - .buildClient(); + .endpoint("") + .sasToken("") + .containerName("mycontainer") + .blobName("myblob") + .buildClient(); ``` or + ```java BlobClient blobClient = new BlobClientBuilder() - .endpoint("" + "/" + "mycontainer" + "/" + "myblob" +"?" + "") - .buildClient(); + .endpoint("" + "/" + "mycontainer" + "/" + "myblob" +"?" + "") + .buildClient(); ``` ### Create a container Create a container using a `BlobServiceClient`. + ```java blobServiceClient.createBlobContainer("mycontainer"); ``` @@ -206,6 +215,7 @@ or Create a container using a `BlobContainerClient`. + ```java blobContainerClient.create(); ``` @@ -214,11 +224,14 @@ blobContainerClient.create(); Upload from an `InputStream` to a blob using a `BlockBlobClient` generated from a `BlobContainerClient`. + ```java BlockBlobClient blockBlobClient = blobContainerClient.getBlobClient("myblockblob").getBlockBlobClient(); String dataSample = "samples"; try (ByteArrayInputStream dataStream = new ByteArrayInputStream(dataSample.getBytes())) { blockBlobClient.upload(dataStream, dataSample.length()); +} catch (IOException e) { + e.printStackTrace(); } ``` @@ -226,6 +239,7 @@ try (ByteArrayInputStream dataStream = new ByteArrayInputStream(dataSample.getBy Upload a file to a blob using a `BlobClient` generated from a `BlobContainerClient`. + ```java BlobClient blobClient = blobContainerClient.getBlobClient("myblockblob"); blobClient.uploadFromFile("local-file.jpg"); @@ -235,9 +249,12 @@ blobClient.uploadFromFile("local-file.jpg"); Download a blob to an `OutputStream` using a `BlobClient`. + ```java try(ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { blobClient.download(outputStream); +} catch (IOException e) { + e.printStackTrace(); } ``` @@ -245,6 +262,7 @@ try(ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { Download blob to a local file using a `BlobClient`. + ```java blobClient.downloadToFile("downloaded-file.jpg"); ``` @@ -253,22 +271,22 @@ blobClient.downloadToFile("downloaded-file.jpg"); Enumerating all blobs using a `BlobContainerClient`. + ```java -Iterator it = blobContainerClient.listBlobs().iterator(); -it.forEachRemaining( - { blobItem -> System.out.println("This is the blob name: " + blobItem.getName()) } - ); +for (BlobItem blobItem : blobContainerClient.listBlobs()) + System.out.println("This is the blob name: " + blobItem.getName()); ``` ### Authenticate with Azure Identity The [Azure Identity library][identity] provides Azure Active Directory support for authenticating with Azure Storage. + ```java BlobServiceClient blobStorageClient = new BlobServiceClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient(); + .endpoint("") + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); ``` ## Troubleshooting diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ReadmeSamples.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ReadmeSamples.java new file mode 100644 index 000000000000..b388f6113bf3 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ReadmeSamples.java @@ -0,0 +1,125 @@ +package com.azure.storage.blob; + +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.storage.blob.models.BlobItem; +import com.azure.storage.blob.specialized.BlockBlobClient; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + * + * Code samples for the README.md + */ +public class ReadmeSamples { + + private BlobServiceClient blobServiceClient = new BlobServiceClientBuilder().buildClient(); + private BlobContainerClient blobContainerClient = new BlobContainerClientBuilder().buildClient(); + private BlobClient blobClient = new BlobClientBuilder().buildClient(); + + public void getBlobServiceClient1() { + BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() + .endpoint("") + .sasToken("") + .buildClient(); + } + + public void getBlobServiceClient2() { + BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() + .endpoint("" + "?" + "") + .buildClient(); + } + + public void getBlobContainerClient1() { + BlobContainerClient blobContainerClient = blobServiceClient.getBlobContainerClient("mycontainer"); + } + + public void getBlobContainerClient2() { + BlobContainerClient blobContainerClient = new BlobContainerClientBuilder() + .endpoint("") + .sasToken("") + .containerName("mycontainer") + .buildClient(); + } + + public void getBlobContainerClient3() { + BlobContainerClient blobContainerClient = new BlobContainerClientBuilder() + .endpoint("" + "/" + "mycontainer" + "?" + "") + .buildClient(); + } + + public void getBlobClient1() { + BlobClient blobClient = blobContainerClient.getBlobClient("myblob"); + } + + public void getBlobClient2() { + BlobClient blobClient = new BlobClientBuilder() + .endpoint("") + .sasToken("") + .containerName("mycontainer") + .blobName("myblob") + .buildClient(); + } + + public void getBlobClient3() { + BlobClient blobClient = new BlobClientBuilder() + .endpoint("" + "/" + "mycontainer" + "/" + "myblob" +"?" + "") + .buildClient(); + } + + public void createBlobContainerClient1() { + blobServiceClient.createBlobContainer("mycontainer"); + } + + public void createBlobContainerClient2() { + blobContainerClient.create(); + } + + public void uploadBlobFromStream() { + BlockBlobClient blockBlobClient = blobContainerClient.getBlobClient("myblockblob").getBlockBlobClient(); + String dataSample = "samples"; + try (ByteArrayInputStream dataStream = new ByteArrayInputStream(dataSample.getBytes())) { + blockBlobClient.upload(dataStream, dataSample.length()); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void uploadBlobFromFile() { + BlobClient blobClient = blobContainerClient.getBlobClient("myblockblob"); + blobClient.uploadFromFile("local-file.jpg"); + } + + public void downloadBlobToStream() { + try(ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + blobClient.download(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void downloadBlobToFile() { + blobClient.downloadToFile("downloaded-file.jpg"); + } + + public void enumerateBlobs() { + for (BlobItem blobItem : blobContainerClient.listBlobs()) + System.out.println("This is the blob name: " + blobItem.getName()); + } + + public void authWithIdentity() { + BlobServiceClient blobStorageClient = new BlobServiceClientBuilder() + .endpoint("") + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); + } + +} + From 119db58de4a2249aa559213d570c86b7f8cf0d57 Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Mon, 27 Jan 2020 16:06:36 -0800 Subject: [PATCH 2/7] Updated to use embed me in file datalake --- .../azure-storage-file-datalake/README.md | 45 ++++-- .../storage/file/datalake/ReadmeSamples.java | 141 ++++++++++++++++++ 2 files changed, 172 insertions(+), 14 deletions(-) create mode 100644 sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java diff --git a/sdk/storage/azure-storage-file-datalake/README.md b/sdk/storage/azure-storage-file-datalake/README.md index 71da4b117273..b62aa4d76e49 100644 --- a/sdk/storage/azure-storage-file-datalake/README.md +++ b/sdk/storage/azure-storage-file-datalake/README.md @@ -148,6 +148,7 @@ The following sections provide several code snippets covering some of the most c Create a `DataLakeServiceClient` using the [`sasToken`](#get-credentials) generated above. + ```java DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() .endpoint("") @@ -157,6 +158,7 @@ DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() or + ```java DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() .endpoint("" + "?" + "") @@ -167,6 +169,7 @@ DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() Create a `DataLakeFileSystemClient` using a `DataLakeServiceClient`. + ```java DataLakeFileSystemClient dataLakeFileSystemClient = dataLakeServiceClient.getFileSystemClient("myfilesystem"); ``` @@ -175,6 +178,7 @@ or Create a `DataLakeFileSystemClient` from the builder [`sasToken`](#get-credentials) generated above. + ```java DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() .endpoint("") @@ -185,6 +189,7 @@ DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClient or + ```java DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() .endpoint("" + "/" + "myfilesystem" + "?" + "") @@ -195,6 +200,7 @@ DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClient Create a `DataLakeFileClient` using a `DataLakeFileSystemClient`. + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); ``` @@ -203,27 +209,30 @@ or Create a `FileClient` from the builder [`sasToken`](#get-credentials) generated above. + ```java DataLakeFileClient fileClient = new DataLakePathClientBuilder() .endpoint("") .sasToken("") .fileSystemName("myfilesystem") .pathName("myfile") - .buildClient(); + .buildFileClient(); ``` or + ```java DataLakeFileClient fileClient = new DataLakePathClientBuilder() .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" +"?" + "") - .buildClient(); + .buildFileClient(); ``` ### Create a `DataLakeDirectoryClient` Get a `DataLakeDirectoryClient` using a `DataLakeFileSystemClient`. + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); ``` @@ -232,27 +241,30 @@ or Create a `DirectoryClient` from the builder [`sasToken`](#get-credentials) generated above. + ```java DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() .endpoint("") .sasToken("") .fileSystemName("myfilesystem") .pathName("mydir") - .buildClient(); + .buildDirectoryClient(); ``` or + ```java -DataLakeFileClient fileClient = new DataLakePathClientBuilder() +DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" +"?" + "") - .buildClient(); + .buildDirectoryClient(); ``` ### Create a file system Create a file system using a `DataLakeServiceClient`. + ```java dataLakeServiceClient.createFileSystem("myfilesystem"); ``` @@ -261,6 +273,7 @@ or Create a file system using a `DataLakeFileSystemClient`. + ```java dataLakeFileSystemClient.create(); ``` @@ -269,37 +282,39 @@ dataLakeFileSystemClient.create(); Enumerating all paths using a `DataLakeFileSystemClient`. + ```java -Iterator it = dataLakeFileSystemClient.listPaths().iterator(); -it.forEachRemaining( - { pathItem -> System.out.println("This is the path name: " + pathItem.getName()) } - ); +for (PathItem pathItem : dataLakeFileSystemClient.listPaths()) + System.out.println("This is the path name: " + pathItem.getName()); ``` ### Rename a file Rename a file using a `DataLakeFileClient`. + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); fileClient.create(); -fileClient.rename("new-file-name") +fileClient.rename("new-file-system-name", "new-file-name"); ``` ### Rename a directory Rename a directory using a `DataLakeDirectoryClient`. + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); directoryClient.create(); -directoryClient.rename("new-directory-name") +directoryClient.rename("new-file-system-name", "new-directory-name"); ``` ### Get file properties Get properties from a file using a `DataLakeFileClient`. + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); fileClient.create(); @@ -310,6 +325,7 @@ PathProperties properties = fileClient.getProperties(); Get properties from a directory using a `DataLakeDirectoryClient`. + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); directoryClient.create(); @@ -320,11 +336,12 @@ PathProperties properties = directoryClient.getProperties(); The [Azure Identity library][identity] provides Azure Active Directory support for authenticating with Azure Storage. + ```java DataLakeServiceClient storageClient = new DataLakeServiceClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient(); + .endpoint("") + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); ``` ## Troubleshooting diff --git a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java new file mode 100644 index 000000000000..d7ae5cb6bc83 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java @@ -0,0 +1,141 @@ +package com.azure.storage.file.datalake; + +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.storage.blob.models.BlobItem; +import com.azure.storage.blob.specialized.BlockBlobClient; +import com.azure.storage.file.datalake.models.PathItem; +import com.azure.storage.file.datalake.models.PathProperties; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + * + * Code samples for the README.md + */ +public class ReadmeSamples { + + private DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder().buildClient(); + private DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder().buildClient(); + private DataLakeFileClient dataLakeFileClient = new DataLakePathClientBuilder().buildFileClient(); + private DataLakeDirectoryClient dataLakeDirectoryClient = new DataLakePathClientBuilder().buildDirectoryClient(); + + public void getDataLakeServiceClient1() { + DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() + .endpoint("") + .sasToken("") + .buildClient(); + } + + public void getDataLakeServiceClient2() { + DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() + .endpoint("" + "?" + "") + .buildClient(); + } + + public void getDataLakeFileSystemClient1() { + DataLakeFileSystemClient dataLakeFileSystemClient = dataLakeServiceClient.getFileSystemClient("myfilesystem"); + } + + public void getDataLakeFileSystemClient2() { + DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() + .endpoint("") + .sasToken("") + .fileSystemName("myfilesystem") + .buildClient(); + } + + public void getDataLakeFileSystemClient3() { + DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() + .endpoint("" + "/" + "myfilesystem" + "?" + "") + .buildClient(); + } + + public void getFileClient1() { + DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); + } + + public void getFileClient2() { + DataLakeFileClient fileClient = new DataLakePathClientBuilder() + .endpoint("") + .sasToken("") + .fileSystemName("myfilesystem") + .pathName("myfile") + .buildFileClient(); + } + + public void getFileClient3() { + DataLakeFileClient fileClient = new DataLakePathClientBuilder() + .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" +"?" + "") + .buildFileClient(); + } + + public void getDirClient1() { + DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); + } + + public void getDirClient2() { + DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() + .endpoint("") + .sasToken("") + .fileSystemName("myfilesystem") + .pathName("mydir") + .buildDirectoryClient(); + } + + public void getDirClient3() { + DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() + .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" +"?" + "") + .buildDirectoryClient(); + } + + public void createDataLakeFileSystemClient1() { + dataLakeServiceClient.createFileSystem("myfilesystem"); + } + + public void createDataLakeFileSystemClient2() { + dataLakeFileSystemClient.create(); + } + + public void enumeratePaths() { + for (PathItem pathItem : dataLakeFileSystemClient.listPaths()) + System.out.println("This is the path name: " + pathItem.getName()); + } + + public void renameFile() { + DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); + fileClient.create(); + fileClient.rename("new-file-system-name", "new-file-name"); + } + + public void renameDirectory() { + DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); + directoryClient.create(); + directoryClient.rename("new-file-system-name", "new-directory-name"); + } + + public void getPropertiesFile() { + DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); + fileClient.create(); + PathProperties properties = fileClient.getProperties(); + } + + public void getPropertiesDirectory() { + DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); + directoryClient.create(); + PathProperties properties = directoryClient.getProperties(); + } + + public void authWithIdentity() { + DataLakeServiceClient storageClient = new DataLakeServiceClientBuilder() + .endpoint("") + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); + } + +} + From b7cfb6f04fb9f9da6611a7973b9fde46a7679155 Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Tue, 28 Jan 2020 09:42:42 -0800 Subject: [PATCH 3/7] Analyze step issues --- sdk/storage/azure-storage-blob/README.md | 11 ++++++----- .../java/com/azure/storage/blob/ReadmeSamples.java | 12 ++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index ae4850c3015d..35c283bd7025 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -198,7 +198,7 @@ or ```java BlobClient blobClient = new BlobClientBuilder() - .endpoint("" + "/" + "mycontainer" + "/" + "myblob" +"?" + "") + .endpoint("" + "/" + "mycontainer" + "/" + "myblob" + "?" + "") .buildClient(); ``` @@ -251,7 +251,7 @@ Download a blob to an `OutputStream` using a `BlobClient`. ```java -try(ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { +try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { blobClient.download(outputStream); } catch (IOException e) { e.printStackTrace(); @@ -271,17 +271,18 @@ blobClient.downloadToFile("downloaded-file.jpg"); Enumerating all blobs using a `BlobContainerClient`. - + ```java -for (BlobItem blobItem : blobContainerClient.listBlobs()) +for (BlobItem blobItem : blobContainerClient.listBlobs()) { System.out.println("This is the blob name: " + blobItem.getName()); +} ``` ### Authenticate with Azure Identity The [Azure Identity library][identity] provides Azure Active Directory support for authenticating with Azure Storage. - + ```java BlobServiceClient blobStorageClient = new BlobServiceClientBuilder() .endpoint("") diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ReadmeSamples.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ReadmeSamples.java index b388f6113bf3..003e72f8e6a3 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ReadmeSamples.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ReadmeSamples.java @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.azure.storage.blob; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -7,9 +9,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; /** * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS @@ -70,7 +69,7 @@ public void getBlobClient2() { public void getBlobClient3() { BlobClient blobClient = new BlobClientBuilder() - .endpoint("" + "/" + "mycontainer" + "/" + "myblob" +"?" + "") + .endpoint("" + "/" + "mycontainer" + "/" + "myblob" + "?" + "") .buildClient(); } @@ -98,7 +97,7 @@ public void uploadBlobFromFile() { } public void downloadBlobToStream() { - try(ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { blobClient.download(outputStream); } catch (IOException e) { e.printStackTrace(); @@ -110,8 +109,9 @@ public void downloadBlobToFile() { } public void enumerateBlobs() { - for (BlobItem blobItem : blobContainerClient.listBlobs()) + for (BlobItem blobItem : blobContainerClient.listBlobs()) { System.out.println("This is the blob name: " + blobItem.getName()); + } } public void authWithIdentity() { From 80b9619c93250434dda4ad3f545105946de944dd Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Tue, 28 Jan 2020 09:56:24 -0800 Subject: [PATCH 4/7] updated readme lines --- sdk/storage/azure-storage-blob/README.md | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index 35c283bd7025..2d76eaaf1353 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -124,7 +124,7 @@ The following sections provide several code snippets covering some of the most c Create a `BlobServiceClient` using the [`sasToken`](#get-credentials) generated above. - + ```java BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() .endpoint("") @@ -134,7 +134,7 @@ BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() or - + ```java BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() .endpoint("" + "?" + "") @@ -145,14 +145,14 @@ BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() Create a `BlobContainerClient` using a `BlobServiceClient`. - + ```java BlobContainerClient blobContainerClient = blobServiceClient.getBlobContainerClient("mycontainer"); ``` Create a `BlobContainerClient` from the builder [`sasToken`](#get-credentials) generated above. - + ```java BlobContainerClient blobContainerClient = new BlobContainerClientBuilder() .endpoint("") @@ -163,7 +163,7 @@ BlobContainerClient blobContainerClient = new BlobContainerClientBuilder() or - + ```java BlobContainerClient blobContainerClient = new BlobContainerClientBuilder() .endpoint("" + "/" + "mycontainer" + "?" + "") @@ -174,7 +174,7 @@ BlobContainerClient blobContainerClient = new BlobContainerClientBuilder() Create a `BlobClient` using a `BlobContainerClient`. - + ```java BlobClient blobClient = blobContainerClient.getBlobClient("myblob"); ``` @@ -183,7 +183,7 @@ or Create a `BlobClient` from the builder [`sasToken`](#get-credentials) generated above. - + ```java BlobClient blobClient = new BlobClientBuilder() .endpoint("") @@ -195,7 +195,7 @@ BlobClient blobClient = new BlobClientBuilder() or - + ```java BlobClient blobClient = new BlobClientBuilder() .endpoint("" + "/" + "mycontainer" + "/" + "myblob" + "?" + "") @@ -206,7 +206,7 @@ BlobClient blobClient = new BlobClientBuilder() Create a container using a `BlobServiceClient`. - + ```java blobServiceClient.createBlobContainer("mycontainer"); ``` @@ -215,7 +215,7 @@ or Create a container using a `BlobContainerClient`. - + ```java blobContainerClient.create(); ``` @@ -224,7 +224,7 @@ blobContainerClient.create(); Upload from an `InputStream` to a blob using a `BlockBlobClient` generated from a `BlobContainerClient`. - + ```java BlockBlobClient blockBlobClient = blobContainerClient.getBlobClient("myblockblob").getBlockBlobClient(); String dataSample = "samples"; @@ -239,7 +239,7 @@ try (ByteArrayInputStream dataStream = new ByteArrayInputStream(dataSample.getBy Upload a file to a blob using a `BlobClient` generated from a `BlobContainerClient`. - + ```java BlobClient blobClient = blobContainerClient.getBlobClient("myblockblob"); blobClient.uploadFromFile("local-file.jpg"); @@ -249,7 +249,7 @@ blobClient.uploadFromFile("local-file.jpg"); Download a blob to an `OutputStream` using a `BlobClient`. - + ```java try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { blobClient.download(outputStream); @@ -262,7 +262,7 @@ try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { Download blob to a local file using a `BlobClient`. - + ```java blobClient.downloadToFile("downloaded-file.jpg"); ``` @@ -282,7 +282,7 @@ for (BlobItem blobItem : blobContainerClient.listBlobs()) { The [Azure Identity library][identity] provides Azure Active Directory support for authenticating with Azure Storage. - + ```java BlobServiceClient blobStorageClient = new BlobServiceClientBuilder() .endpoint("") From 1bcd9d68d27f9551b682e08312952ce827e75b4c Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Tue, 28 Jan 2020 10:13:46 -0800 Subject: [PATCH 5/7] Updated datalake --- .../azure-storage-file-datalake/README.md | 41 ++++++++++--------- .../storage/file/datalake/ReadmeSamples.java | 9 +--- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/sdk/storage/azure-storage-file-datalake/README.md b/sdk/storage/azure-storage-file-datalake/README.md index b62aa4d76e49..c1b8cd108c0d 100644 --- a/sdk/storage/azure-storage-file-datalake/README.md +++ b/sdk/storage/azure-storage-file-datalake/README.md @@ -148,7 +148,7 @@ The following sections provide several code snippets covering some of the most c Create a `DataLakeServiceClient` using the [`sasToken`](#get-credentials) generated above. - + ```java DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() .endpoint("") @@ -158,7 +158,7 @@ DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() or - + ```java DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() .endpoint("" + "?" + "") @@ -169,7 +169,7 @@ DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() Create a `DataLakeFileSystemClient` using a `DataLakeServiceClient`. - + ```java DataLakeFileSystemClient dataLakeFileSystemClient = dataLakeServiceClient.getFileSystemClient("myfilesystem"); ``` @@ -178,7 +178,7 @@ or Create a `DataLakeFileSystemClient` from the builder [`sasToken`](#get-credentials) generated above. - + ```java DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() .endpoint("") @@ -189,7 +189,7 @@ DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClient or - + ```java DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() .endpoint("" + "/" + "myfilesystem" + "?" + "") @@ -200,7 +200,7 @@ DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClient Create a `DataLakeFileClient` using a `DataLakeFileSystemClient`. - + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); ``` @@ -209,7 +209,7 @@ or Create a `FileClient` from the builder [`sasToken`](#get-credentials) generated above. - + ```java DataLakeFileClient fileClient = new DataLakePathClientBuilder() .endpoint("") @@ -221,7 +221,7 @@ DataLakeFileClient fileClient = new DataLakePathClientBuilder() or - + ```java DataLakeFileClient fileClient = new DataLakePathClientBuilder() .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" +"?" + "") @@ -232,7 +232,7 @@ DataLakeFileClient fileClient = new DataLakePathClientBuilder() Get a `DataLakeDirectoryClient` using a `DataLakeFileSystemClient`. - + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); ``` @@ -241,7 +241,7 @@ or Create a `DirectoryClient` from the builder [`sasToken`](#get-credentials) generated above. - + ```java DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() .endpoint("") @@ -253,7 +253,7 @@ DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() or - + ```java DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" +"?" + "") @@ -264,7 +264,7 @@ DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() Create a file system using a `DataLakeServiceClient`. - + ```java dataLakeServiceClient.createFileSystem("myfilesystem"); ``` @@ -273,7 +273,7 @@ or Create a file system using a `DataLakeFileSystemClient`. - + ```java dataLakeFileSystemClient.create(); ``` @@ -282,17 +282,18 @@ dataLakeFileSystemClient.create(); Enumerating all paths using a `DataLakeFileSystemClient`. - + ```java -for (PathItem pathItem : dataLakeFileSystemClient.listPaths()) +for (PathItem pathItem : dataLakeFileSystemClient.listPaths()) { System.out.println("This is the path name: " + pathItem.getName()); +} ``` ### Rename a file Rename a file using a `DataLakeFileClient`. - + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); fileClient.create(); @@ -303,7 +304,7 @@ fileClient.rename("new-file-system-name", "new-file-name"); Rename a directory using a `DataLakeDirectoryClient`. - + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); directoryClient.create(); @@ -314,7 +315,7 @@ directoryClient.rename("new-file-system-name", "new-directory-name"); Get properties from a file using a `DataLakeFileClient`. - + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); fileClient.create(); @@ -325,7 +326,7 @@ PathProperties properties = fileClient.getProperties(); Get properties from a directory using a `DataLakeDirectoryClient`. - + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); directoryClient.create(); @@ -336,7 +337,7 @@ PathProperties properties = directoryClient.getProperties(); The [Azure Identity library][identity] provides Azure Active Directory support for authenticating with Azure Storage. - + ```java DataLakeServiceClient storageClient = new DataLakeServiceClientBuilder() .endpoint("") diff --git a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java index d7ae5cb6bc83..a6a07bea50cf 100644 --- a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java +++ b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java @@ -1,15 +1,9 @@ package com.azure.storage.file.datalake; import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.storage.blob.models.BlobItem; -import com.azure.storage.blob.specialized.BlockBlobClient; import com.azure.storage.file.datalake.models.PathItem; import com.azure.storage.file.datalake.models.PathProperties; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; - /** * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING @@ -102,8 +96,9 @@ public void createDataLakeFileSystemClient2() { } public void enumeratePaths() { - for (PathItem pathItem : dataLakeFileSystemClient.listPaths()) + for (PathItem pathItem : dataLakeFileSystemClient.listPaths()) { System.out.println("This is the path name: " + pathItem.getName()); + } } public void renameFile() { From ac937b238876286d2ec76de8331a52f2fbbb4caa Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Tue, 28 Jan 2020 10:44:51 -0800 Subject: [PATCH 6/7] fixed spacing --- .../azure-storage-file-datalake/README.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sdk/storage/azure-storage-file-datalake/README.md b/sdk/storage/azure-storage-file-datalake/README.md index c1b8cd108c0d..f63ad685c839 100644 --- a/sdk/storage/azure-storage-file-datalake/README.md +++ b/sdk/storage/azure-storage-file-datalake/README.md @@ -151,9 +151,9 @@ Create a `DataLakeServiceClient` using the [`sasToken`](#get-credentials) genera ```java DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() - .endpoint("") - .sasToken("") - .buildClient(); + .endpoint("") + .sasToken("") + .buildClient(); ``` or @@ -161,8 +161,8 @@ or ```java DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() - .endpoint("" + "?" + "") - .buildClient(); + .endpoint("" + "?" + "") + .buildClient(); ``` ### Create a `DataLakeFileSystemClient` @@ -181,10 +181,10 @@ Create a `DataLakeFileSystemClient` from the builder [`sasToken`](#get-credentia ```java DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() - .endpoint("") - .sasToken("") - .fileSystemName("myfilesystem") - .buildClient(); + .endpoint("") + .sasToken("") + .fileSystemName("myfilesystem") + .buildClient(); ``` or @@ -192,8 +192,8 @@ or ```java DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() - .endpoint("" + "/" + "myfilesystem" + "?" + "") - .buildClient(); + .endpoint("" + "/" + "myfilesystem" + "?" + "") + .buildClient(); ``` ### Create a `DataLakeFileClient` @@ -212,11 +212,11 @@ Create a `FileClient` from the builder [`sasToken`](#get-credentials) generated ```java DataLakeFileClient fileClient = new DataLakePathClientBuilder() - .endpoint("") - .sasToken("") - .fileSystemName("myfilesystem") - .pathName("myfile") - .buildFileClient(); + .endpoint("") + .sasToken("") + .fileSystemName("myfilesystem") + .pathName("myfile") + .buildFileClient(); ``` or @@ -224,8 +224,8 @@ or ```java DataLakeFileClient fileClient = new DataLakePathClientBuilder() - .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" +"?" + "") - .buildFileClient(); + .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" +"?" + "") + .buildFileClient(); ``` ### Create a `DataLakeDirectoryClient` @@ -244,11 +244,11 @@ Create a `DirectoryClient` from the builder [`sasToken`](#get-credentials) gener ```java DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() - .endpoint("") - .sasToken("") - .fileSystemName("myfilesystem") - .pathName("mydir") - .buildDirectoryClient(); + .endpoint("") + .sasToken("") + .fileSystemName("myfilesystem") + .pathName("mydir") + .buildDirectoryClient(); ``` or @@ -256,8 +256,8 @@ or ```java DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() - .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" +"?" + "") - .buildDirectoryClient(); + .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" +"?" + "") + .buildDirectoryClient(); ``` ### Create a file system From 1dab6243c23c5112bd42216b34c2881b0b673f14 Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Tue, 28 Jan 2020 10:58:35 -0800 Subject: [PATCH 7/7] updated line numers --- .../azure-storage-file-datalake/README.md | 42 +++++++++---------- .../storage/file/datalake/ReadmeSamples.java | 7 +++- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/sdk/storage/azure-storage-file-datalake/README.md b/sdk/storage/azure-storage-file-datalake/README.md index f63ad685c839..fb91fbf7da17 100644 --- a/sdk/storage/azure-storage-file-datalake/README.md +++ b/sdk/storage/azure-storage-file-datalake/README.md @@ -148,7 +148,7 @@ The following sections provide several code snippets covering some of the most c Create a `DataLakeServiceClient` using the [`sasToken`](#get-credentials) generated above. - + ```java DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() .endpoint("") @@ -158,7 +158,7 @@ DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() or - + ```java DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() .endpoint("" + "?" + "") @@ -169,7 +169,7 @@ DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder() Create a `DataLakeFileSystemClient` using a `DataLakeServiceClient`. - + ```java DataLakeFileSystemClient dataLakeFileSystemClient = dataLakeServiceClient.getFileSystemClient("myfilesystem"); ``` @@ -178,7 +178,7 @@ or Create a `DataLakeFileSystemClient` from the builder [`sasToken`](#get-credentials) generated above. - + ```java DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() .endpoint("") @@ -189,7 +189,7 @@ DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClient or - + ```java DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClientBuilder() .endpoint("" + "/" + "myfilesystem" + "?" + "") @@ -200,7 +200,7 @@ DataLakeFileSystemClient dataLakeFileSystemClient = new DataLakeFileSystemClient Create a `DataLakeFileClient` using a `DataLakeFileSystemClient`. - + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); ``` @@ -209,7 +209,7 @@ or Create a `FileClient` from the builder [`sasToken`](#get-credentials) generated above. - + ```java DataLakeFileClient fileClient = new DataLakePathClientBuilder() .endpoint("") @@ -221,10 +221,10 @@ DataLakeFileClient fileClient = new DataLakePathClientBuilder() or - + ```java DataLakeFileClient fileClient = new DataLakePathClientBuilder() - .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" +"?" + "") + .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" + "?" + "") .buildFileClient(); ``` @@ -232,7 +232,7 @@ DataLakeFileClient fileClient = new DataLakePathClientBuilder() Get a `DataLakeDirectoryClient` using a `DataLakeFileSystemClient`. - + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); ``` @@ -241,7 +241,7 @@ or Create a `DirectoryClient` from the builder [`sasToken`](#get-credentials) generated above. - + ```java DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() .endpoint("") @@ -253,10 +253,10 @@ DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() or - + ```java DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() - .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" +"?" + "") + .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" + "?" + "") .buildDirectoryClient(); ``` @@ -264,7 +264,7 @@ DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() Create a file system using a `DataLakeServiceClient`. - + ```java dataLakeServiceClient.createFileSystem("myfilesystem"); ``` @@ -273,7 +273,7 @@ or Create a file system using a `DataLakeFileSystemClient`. - + ```java dataLakeFileSystemClient.create(); ``` @@ -282,7 +282,7 @@ dataLakeFileSystemClient.create(); Enumerating all paths using a `DataLakeFileSystemClient`. - + ```java for (PathItem pathItem : dataLakeFileSystemClient.listPaths()) { System.out.println("This is the path name: " + pathItem.getName()); @@ -293,7 +293,7 @@ for (PathItem pathItem : dataLakeFileSystemClient.listPaths()) { Rename a file using a `DataLakeFileClient`. - + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); fileClient.create(); @@ -304,7 +304,7 @@ fileClient.rename("new-file-system-name", "new-file-name"); Rename a directory using a `DataLakeDirectoryClient`. - + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); directoryClient.create(); @@ -315,7 +315,7 @@ directoryClient.rename("new-file-system-name", "new-directory-name"); Get properties from a file using a `DataLakeFileClient`. - + ```java DataLakeFileClient fileClient = dataLakeFileSystemClient.getFileClient("myfile"); fileClient.create(); @@ -326,7 +326,7 @@ PathProperties properties = fileClient.getProperties(); Get properties from a directory using a `DataLakeDirectoryClient`. - + ```java DataLakeDirectoryClient directoryClient = dataLakeFileSystemClient.getDirectoryClient("mydir"); directoryClient.create(); @@ -337,7 +337,7 @@ PathProperties properties = directoryClient.getProperties(); The [Azure Identity library][identity] provides Azure Active Directory support for authenticating with Azure Storage. - + ```java DataLakeServiceClient storageClient = new DataLakeServiceClientBuilder() .endpoint("") diff --git a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java index a6a07bea50cf..6990f330d2d7 100644 --- a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java +++ b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/ReadmeSamples.java @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.azure.storage.file.datalake; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -64,7 +67,7 @@ public void getFileClient2() { public void getFileClient3() { DataLakeFileClient fileClient = new DataLakePathClientBuilder() - .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" +"?" + "") + .endpoint("" + "/" + "myfilesystem" + "/" + "myfile" + "?" + "") .buildFileClient(); } @@ -83,7 +86,7 @@ public void getDirClient2() { public void getDirClient3() { DataLakeDirectoryClient directoryClient = new DataLakePathClientBuilder() - .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" +"?" + "") + .endpoint("" + "/" + "myfilesystem" + "/" + "mydir" + "?" + "") .buildDirectoryClient(); }