public class DataLakeDirectoryClient extends DataLakePathClient
This client is instantiated through DataLakePathClientBuilder
or retrieved via
getDirectoryClient
.
Please refer to the Azure Docs for more information.
Modifier and Type | Method and Description |
---|---|
DataLakeFileClient |
createFile(String fileName)
Creates a new file within a directory.
|
DataLakeFileClient |
createFile(String fileName,
boolean overwrite)
Creates a new file within a directory.
|
com.azure.core.http.rest.Response<DataLakeFileClient> |
createFileWithResponse(String fileName,
String permissions,
String umask,
PathHttpHeaders headers,
Map<String,String> metadata,
DataLakeRequestConditions requestConditions,
Duration timeout,
com.azure.core.util.Context context)
Creates a new file within a directory.
|
DataLakeDirectoryClient |
createSubdirectory(String subdirectoryName)
Creates a new sub-directory within a directory.
|
DataLakeDirectoryClient |
createSubdirectory(String subdirectoryName,
boolean overwrite)
Creates a new sub-directory within a directory.
|
com.azure.core.http.rest.Response<DataLakeDirectoryClient> |
createSubdirectoryWithResponse(String subdirectoryName,
String permissions,
String umask,
PathHttpHeaders headers,
Map<String,String> metadata,
DataLakeRequestConditions requestConditions,
Duration timeout,
com.azure.core.util.Context context)
Creates a new sub-directory within a directory.
|
void |
delete()
Deletes a directory.
|
void |
deleteFile(String fileName)
Deletes the specified file in the directory.
|
com.azure.core.http.rest.Response<Void> |
deleteFileWithResponse(String fileName,
DataLakeRequestConditions requestConditions,
Duration timeout,
com.azure.core.util.Context context)
Deletes the specified file in the directory.
|
void |
deleteSubdirectory(String subdirectoryName)
Deletes the specified sub-directory in the directory.
|
com.azure.core.http.rest.Response<Void> |
deleteSubdirectoryWithResponse(String subdirectoryName,
boolean recursive,
DataLakeRequestConditions requestConditions,
Duration timeout,
com.azure.core.util.Context context)
Deletes the specified sub-directory in the directory.
|
com.azure.core.http.rest.Response<Void> |
deleteWithResponse(boolean recursive,
DataLakeRequestConditions requestConditions,
Duration timeout,
com.azure.core.util.Context context)
Deletes a directory.
|
String |
getDirectoryName()
Gets the name of this directory, not including its full path.
|
String |
getDirectoryPath()
Gets the path of this directory, not including the name of the resource itself.
|
String |
getDirectoryUrl()
Gets the URL of the directory represented by this client on the Data Lake service.
|
DataLakeFileClient |
getFileClient(String fileName)
Initializes a new DataLakeFileClient object by concatenating fileName to the end of DataLakeDirectoryClient's
URL.
|
DataLakeDirectoryClient |
getSubdirectoryClient(String subdirectoryName)
Initializes a new DataLakeDirectoryClient object by concatenating directoryName to the end of
DataLakeDirectoryClient's URL.
|
DataLakeDirectoryClient |
rename(String destinationFileSystem,
String destinationPath)
Moves the directory to another location within the file system.
|
com.azure.core.http.rest.Response<DataLakeDirectoryClient> |
renameWithResponse(String destinationFileSystem,
String destinationPath,
DataLakeRequestConditions sourceRequestConditions,
DataLakeRequestConditions destinationRequestConditions,
Duration timeout,
com.azure.core.util.Context context)
Moves the directory to another location within the file system.
|
create, create, createWithResponse, exists, existsWithResponse, generateSas, generateUserDelegationSas, getAccessControl, getAccessControlWithResponse, getAccountName, getFileSystemName, getHttpPipeline, getProperties, getPropertiesWithResponse, getServiceVersion, setAccessControlList, setAccessControlListWithResponse, setHttpHeaders, setHttpHeadersWithResponse, setMetadata, setMetadataWithResponse, setPermissions, setPermissionsWithResponse
public String getDirectoryUrl()
public String getDirectoryPath()
public String getDirectoryName()
public void delete()
Code Samples
client.delete(); System.out.println("Delete request completed");
For more information see the Azure Docs
public com.azure.core.http.rest.Response<Void> deleteWithResponse(boolean recursive, DataLakeRequestConditions requestConditions, Duration timeout, com.azure.core.util.Context context)
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions() .setLeaseId(leaseId); boolean recursive = false; // Default value client.deleteWithResponse(recursive, requestConditions, timeout, new Context(key1, value1)); System.out.println("Delete request completed");
For more information see the Azure Docs
recursive
- Whether or not to delete all paths beneath the directory.requestConditions
- DataLakeRequestConditions
timeout
- An optional timeout value beyond which a RuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.public DataLakeFileClient getFileClient(String fileName)
fileName
- A String
representing the name of the file.
Code Samples
DataLakeFileClient dataLakeFileClient = client.getFileClient(fileName);
DataLakeFileClient
object which references the file with the specified name in this
directory.public DataLakeFileClient createFile(String fileName)
Code Samples
DataLakeFileClient fileClient = client.createFile(fileName);
fileName
- Name of the file to create.DataLakeFileClient
used to interact with the file created.public DataLakeFileClient createFile(String fileName, boolean overwrite)
Code Samples
boolean overwrite = false; /* Default value. */ DataLakeFileClient fClient = client.createFile(fileName, overwrite);
fileName
- Name of the file to create.overwrite
- Whether or not to overwrite, should a file exist.DataLakeFileClient
used to interact with the file created.public com.azure.core.http.rest.Response<DataLakeFileClient> createFileWithResponse(String fileName, String permissions, String umask, PathHttpHeaders headers, Map<String,String> metadata, DataLakeRequestConditions requestConditions, Duration timeout, com.azure.core.util.Context context)
Code Samples
PathHttpHeaders httpHeaders = new PathHttpHeaders() .setContentLanguage("en-US") .setContentType("binary"); DataLakeRequestConditions requestConditions = new DataLakeRequestConditions() .setLeaseId(leaseId); String permissions = "permissions"; String umask = "umask"; Response<DataLakeFileClient> newFileClient = client.createFileWithResponse(fileName, permissions, umask, httpHeaders, Collections.singletonMap("metadata", "value"), requestConditions, timeout, new Context(key1, value1));
fileName
- Name of the file to create.permissions
- POSIX access permissions for the file owner, the file owning group, and others.umask
- Restricts permissions of the file to be created.headers
- PathHttpHeaders
metadata
- Metadata to associate with the file.requestConditions
- DataLakeRequestConditions
timeout
- An optional timeout value beyond which a RuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.Response
whose value
contains the DataLakeFileClient
used
to interact with the file created.public void deleteFile(String fileName)
Code Samples
client.deleteFile(fileName); System.out.println("Delete request completed");
fileName
- Name of the file to delete.public com.azure.core.http.rest.Response<Void> deleteFileWithResponse(String fileName, DataLakeRequestConditions requestConditions, Duration timeout, com.azure.core.util.Context context)
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions() .setLeaseId(leaseId); client.deleteFileWithResponse(fileName, requestConditions, timeout, new Context(key1, value1)); System.out.println("Delete request completed");
fileName
- Name of the file to delete.requestConditions
- DataLakeRequestConditions
timeout
- An optional timeout value beyond which a RuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.public DataLakeDirectoryClient getSubdirectoryClient(String subdirectoryName)
subdirectoryName
- A String
representing the name of the sub-directory.
Code Samples
DataLakeDirectoryClient dataLakeDirectoryClient = client.getSubdirectoryClient(directoryName);
DataLakeDirectoryClient
object which references the sub-directory with the specified name
in this directorypublic DataLakeDirectoryClient createSubdirectory(String subdirectoryName)
Code Samples
DataLakeDirectoryClient directoryClient = client.createSubdirectory(directoryName);
subdirectoryName
- Name of the sub-directory to create.DataLakeDirectoryClient
used to interact with the sub-directory created.public DataLakeDirectoryClient createSubdirectory(String subdirectoryName, boolean overwrite)
Code Samples
boolean overwrite = false; /* Default value. */ DataLakeDirectoryClient dClient = client.createSubdirectory(fileName, overwrite);
subdirectoryName
- Name of the sub-directory to create.overwrite
- Whether or not to overwrite, should the sub-directory exist.DataLakeDirectoryClient
used to interact with the sub-directory created.public com.azure.core.http.rest.Response<DataLakeDirectoryClient> createSubdirectoryWithResponse(String subdirectoryName, String permissions, String umask, PathHttpHeaders headers, Map<String,String> metadata, DataLakeRequestConditions requestConditions, Duration timeout, com.azure.core.util.Context context)
Code Samples
PathHttpHeaders httpHeaders = new PathHttpHeaders() .setContentLanguage("en-US") .setContentType("binary"); DataLakeRequestConditions requestConditions = new DataLakeRequestConditions() .setLeaseId(leaseId); String permissions = "permissions"; String umask = "umask"; Response<DataLakeDirectoryClient> newDirectoryClient = client.createSubdirectoryWithResponse(directoryName, permissions, umask, httpHeaders, Collections.singletonMap("metadata", "value"), requestConditions, timeout, new Context(key1, value1));
subdirectoryName
- Name of the sub-directory to create.permissions
- POSIX access permissions for the sub-directory owner, the sub-directory owning group, and
others.umask
- Restricts permissions of the sub-directory to be created.headers
- PathHttpHeaders
metadata
- Metadata to associate with the sub-directory.requestConditions
- DataLakeRequestConditions
timeout
- An optional timeout value beyond which a RuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.Response
whose value
contains a DataLakeDirectoryClient
used to interact with the sub-directory created.public void deleteSubdirectory(String subdirectoryName)
Code Samples
client.deleteSubdirectory(directoryName); System.out.println("Delete request completed");
subdirectoryName
- Name of the sub-directory to delete.public com.azure.core.http.rest.Response<Void> deleteSubdirectoryWithResponse(String subdirectoryName, boolean recursive, DataLakeRequestConditions requestConditions, Duration timeout, com.azure.core.util.Context context)
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions() .setLeaseId(leaseId); boolean recursive = false; // Default value client.deleteSubdirectoryWithResponse(directoryName, recursive, requestConditions, timeout, new Context(key1, value1)); System.out.println("Delete request completed");
subdirectoryName
- Name of the sub-directory to delete.recursive
- Whether or not to delete all paths beneath the sub-directory.requestConditions
- DataLakeRequestConditions
timeout
- An optional timeout value beyond which a RuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.public DataLakeDirectoryClient rename(String destinationFileSystem, String destinationPath)
Code Samples
DataLakeDirectoryClient renamedClient = client.rename(fileSystemName, destinationPath); System.out.println("Directory Client has been renamed");
destinationFileSystem
- The file system of the destination within the account.
null
for the current file system.destinationPath
- Relative path from the file system to rename the directory to, excludes the file system
name. For example if you want to move a directory with fileSystem = "myfilesystem", path = "mydir/mysubdir" to
another path in myfilesystem (ex: newdir) then set the destinationPath = "newdir"DataLakeDirectoryClient
used to interact with the new directory created.public com.azure.core.http.rest.Response<DataLakeDirectoryClient> renameWithResponse(String destinationFileSystem, String destinationPath, DataLakeRequestConditions sourceRequestConditions, DataLakeRequestConditions destinationRequestConditions, Duration timeout, com.azure.core.util.Context context)
Code Samples
DataLakeRequestConditions sourceRequestConditions = new DataLakeRequestConditions() .setLeaseId(leaseId); DataLakeRequestConditions destinationRequestConditions = new DataLakeRequestConditions(); DataLakeDirectoryClient newRenamedClient = client.renameWithResponse(fileSystemName, destinationPath, sourceRequestConditions, destinationRequestConditions, timeout, new Context(key1, value1)).getValue(); System.out.println("Directory Client has been renamed");
destinationFileSystem
- The file system of the destination within the account.
null
for the current file system.destinationPath
- Relative path from the file system to rename the directory to, excludes the file system
name. For example if you want to move a directory with fileSystem = "myfilesystem", path = "mydir/mysubdir" to
another path in myfilesystem (ex: newdir) then set the destinationPath = "newdir"sourceRequestConditions
- DataLakeRequestConditions
against the source.destinationRequestConditions
- DataLakeRequestConditions
against the destination.timeout
- An optional timeout value beyond which a RuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.Response
whose value
that contains a
DataLakeDirectoryClient
used to interact with the directory created.Copyright © 2020 Microsoft Corporation. All rights reserved.