| title | Azure Data Lake Store libraries for Java |
|---|---|
| description | Reference documentation for the Java Data Lake Store libraries |
| keywords | Azure, Java, SDK, API, big data, data lake |
| author | rloutlaw |
| ms.author | routlaw |
| manager | douge |
| ms.date | 06/21/2017 |
| ms.topic | article |
| ms.prod | azure |
| ms.technology | azure |
| ms.devlang | java |
| ms.service | data-lake-store |
Capture data of any size, type, and ingestion speed in a single place for analytics with Azure Data Lake Store.
To get started with Data Lake Store, see Get started with Azure Data Lake Store using Java.
Read and write files, set permissions and metadata, and manage files and directories in Data Lake Store with the client library.
Add a dependency to your Maven pom.xml file to use the client library in your project.
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-data-lake-store-sdk</artifactId>
<version>2.1.5</version>
</dependency>Create a Data Lake client from a fully qualified domain name and OAuth2 access token, then create a file in Data Lake and write to it.
// AccessTokenProvider provider = new ClientCredsTokenProvider(authTokenEndpoint, clientId, clientKey);
ADLStoreClient client = ADLStoreClient.createClient(accountFQDN, provider);
// create directory
client.createDirectory("/a/b/w");
// create file and write some content
String filename = "/a/b/c.txt";
OutputStream stream = client.createFile(filename, IfExists.OVERWRITE );
PrintStream out = new PrintStream(stream);
for (int i = 1; i <= 10; i++) {
out.println("This is line #" + i);
out.format("This is the same line (%d), but using formatted output. %n", i);
}
out.close();[!div class="nextstepaction"] Explore the Client APIs
Use the management API to manage Data Lake Store accounts, firewall rules, and trusted identity providers.
Add a dependency to your Maven pom.xml file to use the management API in your project.
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-datalake-store</artifactId>
<version>1.0.0-beta1.3</version>
</dependency>[!div class="nextstepaction"] Explore the Management APIs
Explore more sample Java code for Azure Data Lake Store you can use in your apps.