You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second dependency is to use the Data Lake Storage Gen2 SDK (`azure-storage-file-datalake`) from the Maven repository. The third dependency is to specify the logging framework (`slf4j-nop`) to use for this application. The Data Lake Storage Gen2 SDK uses [SLF4J](https://www.slf4j.org/) logging façade, which lets you choose from a number of popular logging frameworks, like Log4j, Java logging, Logback, etc., or no logging. For this example, we disable logging, hence we use the **slf4j-nop** binding. To use other logging options in your app, see [here](https://www.slf4j.org/manual.html#projectDep).
54
+
The first dependency is to use the Data Lake Storage Gen1 SDK (`azure-data-lake-store-sdk`) from the maven repository. The second dependency is to specify the logging framework (`slf4j-nop`) to use for this application. The Data Lake Storage Gen1 SDK uses [SLF4J](https://www.slf4j.org/) logging façade, which lets you choose from a number of popular logging frameworks, like Log4j, Java logging, Logback, etc., or no logging. For this example, we disable logging, hence we use the **slf4j-nop** binding. To use other logging options in your app, see [here](https://www.slf4j.org/manual.html#projectDep).
60
55
61
56
3. Add the following import statements to your application.
* For end-user authentication for your application, see [End-user-authentication with Data Lake Storage Gen2 using Java](data-lake-store-end-user-authenticate-java-sdk.md).
85
-
* For service-to-service authentication for your application, see [Service-to-service authentication with Data Lake Storage Gen2 using Java](data-lake-store-service-to-service-authenticate-java.md).
73
+
* For end-user authentication for your application, see [End-user-authentication with Data Lake Storage Gen1 using Java](data-lake-store-end-user-authenticate-java-sdk.md).
74
+
* For service-to-service authentication for your application, see [Service-to-service authentication with Data Lake Storage Gen1 using Java](data-lake-store-service-to-service-authenticate-java.md).
86
75
87
-
## Create a Data Lake Storage Gen2 client
88
-
Creating a [DataLakeServiceClient](https://azure.github.io/azure-sdk-for-java/datalakestorage%28gen2%29.html) object requires you to specify the Data Lake Storage Gen2 account name and the token provider you generated when you authenticated with Data Lake Storage Gen2 (see [Authentication](#authentication) section). The Data Lake Storage Gen2 account name needs to be a fully qualified domain name. For example, replace **FILL-IN-HERE** with something like **mydatalakestoragegen1.azuredatalakestore.net**.
76
+
## Create a Data Lake Storage Gen1 client
77
+
Creating an [ADLStoreClient](https://azure.github.io/azure-data-lake-store-java/javadoc/) object requires you to specify the Data Lake Storage Gen1 account name and the token provider you generated when you authenticated with Data Lake Storage Gen1 (see [Authentication](#authentication) section). The Data Lake Storage Gen1 account name needs to be a fully qualified domain name. For example, replace **FILL-IN-HERE** with something like **mydatalakestoragegen1.azuredatalakestore.net**.
89
78
90
79
```java
91
-
private static String endPoint = "FILL-IN-HERE"; // Data lake storage end point
92
-
DataLakeServiceClient dataLakeServiceClient = new DataLakeServiceClientBuilder().endpoint(endPoint).credential(credential).buildClient();
80
+
private static String accountFQDN = "FILL-IN-HERE"; // full account FQDN, not just the account name
The code snippets in the following sections contain examples of some common filesystem operations. You can look at the full [Data Lake Storage Gen2 Java SDK API docs](https://azure.github.io/azure-sdk-for-java/datalakestorage%28gen2%29.html) of the **DataLakeServiceClient** object to see other operations.
84
+
The code snippets in the following sections contain examples of some common filesystem operations. You can look at the full [Data Lake Storage Gen1 Java SDK API docs](https://azure.github.io/azure-data-lake-store-java/javadoc/) of the **ADLStoreClient** object to see other operations.
96
85
97
86
## Create a directory
98
87
99
-
The following snippet creates a directory structure in the root of the Data Lake Storage Gen2 account you specified.
88
+
The following snippet creates a directory structure in the root of the Data Lake Storage Gen1 account you specified.
The definition for `getSampleContent` function used in the preceding snippet is available as part of the sample [on GitHub](https://azure.microsoft.com/documentation/samples/data-lake-store-java-upload-download-get-started/).
@@ -160,10 +143,10 @@ The following snippet reads content from a file in a Data Lake Storage Gen1 acco
The following snippet concatenates two files in a DataLakeStorageGen2 account. If successful, the concatenated file replaces the two existing files.
159
+
The following snippet concatenates two files in a Data Lake Storage Gen1 account. If successful, the concatenated file replaces the two existing files.
List<DirectoryEntry> list = client.enumerateDirectory("/a/b", 2000);
206
+
System.out.println("Directory listing for directory /a/b:");
207
+
for (DirectoryEntry entry : list) {
208
+
printDirectoryInfo(entry);
209
+
}
234
210
System.out.println("Directory contents listed.");
235
211
```
236
212
@@ -242,7 +218,7 @@ The following snippet deletes the specified files and folders in a Data Lake Sto
242
218
243
219
```java
244
220
// delete directory along with all the subdirectories and files in it
245
-
dataLakeFileSystemClient.deleteDirectory("a");
221
+
client.deleteRecursive("/a");
246
222
System.out.println("All files and folders deleted recursively");
247
223
promptEnterKey();
248
224
```
@@ -252,7 +228,6 @@ promptEnterKey();
252
228
2. To produce a standalone jar that you can run from command-line build the jar with all dependencies included, using the [Maven assembly plugin](https://maven.apache.org/plugins/maven-assembly-plugin/usage.html). The pom.xml in the [example source code on GitHub](https://github.com/Azure-Samples/data-lake-store-java-upload-download-get-started/blob/master/pom.xml) has an example.
253
229
254
230
## Next steps
255
-
* [ExploreJavaDocfor the JavaSDK](https://azure.github.io/azure-sdk-for-java/datalakestorage%28gen2%29.html)
256
-
* [Secure data in DataLakeStorageGen2](data-lake-store-secure-data.md)
257
-
231
+
*[Explore JavaDoc for the Java SDK](https://azure.github.io/azure-data-lake-store-java/javadoc/)
232
+
*[Secure data in Data Lake Storage Gen1](data-lake-store-secure-data.md)
0 commit comments