public final class AzureFileSystem extends FileSystem
FileSystem
interface for Azure Blob Storage.
The following behavior is specific to this FileSystem:
In the hierarchy of this file system, an AzureFileSystem
corresponds to an Azure Blob Storage account. A
file store is represented by a container in the storage account. Each container has one root directory.
Closing the file system will not block on outstanding operations. Any operations in progress will be allowed to terminate naturally after the file system is closed, though no further operations may be started after the parent file system is closed.
All instance of AzureFileSystem
are opened for read-write access.
For a more complete description of the uses for the constants described here, please see the instructions for opening
and configuring a FileSystem in the docs of FileSystemProvider
.
Modifier and Type | Field and Description |
---|---|
static String |
AZURE_STORAGE_DOWNLOAD_RESUME_RETRIES
Expected type: Integer
|
static String |
AZURE_STORAGE_FILE_STORES
Expected type: String
|
static String |
AZURE_STORAGE_HTTP_LOG_DETAIL_LEVEL
Expected type: com.azure.core.http.policy.HttpLogLevelDetail
|
static String |
AZURE_STORAGE_MAX_CONCURRENCY_PER_REQUEST
Expected type: Integer
|
static String |
AZURE_STORAGE_MAX_RETRY_DELAY_IN_MS
Expected type: Long
|
static String |
AZURE_STORAGE_MAX_TRIES
Expected type: Integer
|
static String |
AZURE_STORAGE_PUT_BLOB_THRESHOLD
Expected type: Long
|
static String |
AZURE_STORAGE_RETRY_DELAY_IN_MS
Expected type: Long
|
static String |
AZURE_STORAGE_RETRY_POLICY_TYPE
Expected type: com.azure.storage.common.policy.RetryPolicyType
|
static String |
AZURE_STORAGE_SAS_TOKEN_CREDENTIAL
Expected type: String
|
static String |
AZURE_STORAGE_SECONDARY_HOST
Expected type: String
|
static String |
AZURE_STORAGE_SHARED_KEY_CREDENTIAL
Expected type: String
|
static String |
AZURE_STORAGE_TRY_TIMEOUT
Expected type: Integer
|
static String |
AZURE_STORAGE_UPLOAD_BLOCK_SIZE
Expected type: Long
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this file system.
|
boolean |
equals(Object o) |
Iterable<FileStore> |
getFileStores()
Returns an object to iterate over the underlying file stores
|
Path |
getPath(String first,
String... more)
Converts a path string, or a sequence of more that when joined form a path string, to a Path.
|
PathMatcher |
getPathMatcher(String s)
Unsupported.
|
Iterable<Path> |
getRootDirectories()
Returns an object to iterate over the paths of the root directories.
|
String |
getSeparator()
Returns the name separator, represented as a string.
|
UserPrincipalLookupService |
getUserPrincipalLookupService()
Unsupported.
|
int |
hashCode() |
boolean |
isOpen()
Tells whether or not this file system is open.
|
boolean |
isReadOnly()
Tells whether or not this file system allows only read-only access to its file stores.
|
WatchService |
newWatchService()
Unsupported.
|
FileSystemProvider |
provider()
Returns the provider that created this file system.
|
Set<String> |
supportedFileAttributeViews()
Returns the set of the names of the file attribute views supported by this FileSystem.
|
public static final String AZURE_STORAGE_SHARED_KEY_CREDENTIAL
public static final String AZURE_STORAGE_SAS_TOKEN_CREDENTIAL
public static final String AZURE_STORAGE_HTTP_LOG_DETAIL_LEVEL
public static final String AZURE_STORAGE_MAX_TRIES
public static final String AZURE_STORAGE_TRY_TIMEOUT
public static final String AZURE_STORAGE_RETRY_DELAY_IN_MS
public static final String AZURE_STORAGE_MAX_RETRY_DELAY_IN_MS
public static final String AZURE_STORAGE_RETRY_POLICY_TYPE
public static final String AZURE_STORAGE_SECONDARY_HOST
public static final String AZURE_STORAGE_UPLOAD_BLOCK_SIZE
public static final String AZURE_STORAGE_MAX_CONCURRENCY_PER_REQUEST
public static final String AZURE_STORAGE_PUT_BLOB_THRESHOLD
public static final String AZURE_STORAGE_DOWNLOAD_RESUME_RETRIES
public static final String AZURE_STORAGE_FILE_STORES
public FileSystemProvider provider()
provider
in class FileSystem
public void close() throws IOException
After a file system is closed then all subsequent access to the file system, either by methods defined by this class or on objects associated with this file system, throw ClosedFileSystemException. If the file system is already closed then invoking this method has no effect.
Closing the file system will not block on outstanding operations. Any operations in progress will be allowed to terminate naturally after the file system is closed, though no further operations may be started after the parent file system is closed.
Once closed, a file system with the same identifier as the one closed may be re-opened.
close
in interface Closeable
close
in interface AutoCloseable
close
in class FileSystem
IOException
- If an I/O error occurs.public boolean isOpen()
isOpen
in class FileSystem
public boolean isReadOnly()
Always returns false. It may be the case that the authentication method provided to this file system only supports read operations and hence the file system is implicitly read only in this view, but that does not imply the underlying account/file system is inherently read only. Creating/specifying read only file systems is not supported.
isReadOnly
in class FileSystem
public String getSeparator()
The separator used in this file system is "/"
.
getSeparator
in class FileSystem
public Iterable<Path> getRootDirectories()
The list of root directories corresponds to the list of available file stores and therefore containers specified
upon initialization. A root directory always takes the form "<file-store-name>:"
. This list will
respect the parameters provided during initialization.
If a finite list of containers was provided on start up, this list will not change during the lifetime of this object. If containers are added to the account after initialization, they will be ignored. If a container is deleted or otherwise becomes unavailable, its root directory will still be returned but operations to it will fail.
getRootDirectories
in class FileSystem
public Iterable<FileStore> getFileStores()
This list will respect the parameters provided during initialization.
If a finite list of containers was provided on start up, this list will not change during the lifetime of this object. If containers are added to the account after initialization, they will be ignored. If a container is deleted or otherwise becomes unavailable, its root directory will still be returned but operations to it will fail.
getFileStores
in class FileSystem
public Set<String> supportedFileAttributeViews()
This file system supports the following views:
supportedFileAttributeViews
in class FileSystem
public Path getPath(String first, String... more)
If more does not specify any elements then the value of the first parameter is the path string to convert. If more specifies one or more elements then each non-empty string, including first, is considered to be a sequence of name elements (see Path) and is joined to form a path string. The more will be joined using the name separator.
Each name element will be String
-joined to the other elements by this file system'first path separator.
Naming conventions and allowed characters are as
defined
by the Azure Blob Storage service. The root component is interpreted as the container name and all name elements
are interpreted as a part of the blob name. The character ':'
is only allowed in the root component and
must be the last character of the root component.
getPath
in class FileSystem
first
- the path string or initial part of the path stringmore
- additional strings to be joined to form the path stringInvalidPathException
- if the path string cannot be converted.public PathMatcher getPathMatcher(String s) throws IllegalArgumentException, PatternSyntaxException
getPathMatcher
in class FileSystem
s
- the matcherUnsupportedOperationException
- unsupported.IllegalArgumentException
- neverPatternSyntaxException
- neverpublic UserPrincipalLookupService getUserPrincipalLookupService()
getUserPrincipalLookupService
in class FileSystem
UnsupportedOperationException
- unsupported.public WatchService newWatchService() throws IOException
newWatchService
in class FileSystem
UnsupportedOperationException
- unsupported.IOException
- never.Copyright © 2021 Microsoft Corporation. All rights reserved.