Class AzureFileSystem
- All Implemented Interfaces:
Closeable, AutoCloseable
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringExpected type: Integerstatic final StringExpected type: Stringstatic final StringExpected type: com.azure.core.http.policy.HttpLogLevelDetailstatic final StringExpected type: Integerstatic final StringExpected type: Longstatic final StringExpected type: Integerstatic final StringExpected type: Longstatic final StringExpected type: Longstatic final StringExpected type: com.azure.storage.common.policy.RetryPolicyTypestatic final StringExpected type: Stringstatic final StringExpected type: Stringstatic final StringExpected type: Stringstatic final StringExpected type: Booleanstatic final StringExpected type: Integerstatic final StringExpected type: Long -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this file system.booleanReturns an object to iterate over the underlying file storesConverts a path string, or a sequence of more that when joined form a path string, to a Path.Unsupported.Returns an object to iterate over the paths of the root directories.Returns the name separator, represented as a string.Unsupported.inthashCode()booleanisOpen()Tells whether this file system is open.booleanTells whether this file system allows only read-only access to its file stores.Unsupported.provider()Returns the provider that created this file system.Returns the set of the names of the file attribute views supported by this FileSystem.
-
Field Details
-
AZURE_STORAGE_SHARED_KEY_CREDENTIAL
-
AZURE_STORAGE_SAS_TOKEN_CREDENTIAL
-
AZURE_STORAGE_HTTP_LOG_DETAIL_LEVEL
Expected type: com.azure.core.http.policy.HttpLogLevelDetail- See Also:
-
AZURE_STORAGE_MAX_TRIES
-
AZURE_STORAGE_TRY_TIMEOUT
-
AZURE_STORAGE_RETRY_DELAY_IN_MS
-
AZURE_STORAGE_MAX_RETRY_DELAY_IN_MS
-
AZURE_STORAGE_RETRY_POLICY_TYPE
Expected type: com.azure.storage.common.policy.RetryPolicyType- See Also:
-
AZURE_STORAGE_SECONDARY_HOST
-
AZURE_STORAGE_UPLOAD_BLOCK_SIZE
-
AZURE_STORAGE_MAX_CONCURRENCY_PER_REQUEST
Expected type: Integer- See Also:
-
AZURE_STORAGE_PUT_BLOB_THRESHOLD
-
AZURE_STORAGE_DOWNLOAD_RESUME_RETRIES
-
AZURE_STORAGE_FILE_STORES
-
AZURE_STORAGE_SKIP_INITIAL_CONTAINER_CHECK
Expected type: Boolean- See Also:
-
-
Method Details
-
provider
Returns the provider that created this file system.- Specified by:
providerin classFileSystem- Returns:
- the provider that created this file system.
-
close
Closes this file system.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.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFileSystem- Throws:
IOException- If an I/O error occurs.
-
isOpen
public boolean isOpen()Tells whether this file system is open.- Specified by:
isOpenin classFileSystem- Returns:
- whether this file system is open.
-
isReadOnly
public boolean isReadOnly()Tells whether this file system allows only read-only access to its file stores.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.
- Specified by:
isReadOnlyin classFileSystem- Returns:
- false
-
getSeparator
Returns the name separator, represented as a string.The separator used in this file system is
"/".- Specified by:
getSeparatorin classFileSystem- Returns:
- "/"
-
getRootDirectories
Returns an object to iterate over the paths of the root directories.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.
- Specified by:
getRootDirectoriesin classFileSystem- Returns:
- an object to iterate over the paths of the root directories
-
getFileStores
Returns an object to iterate over the underlying file storesThis 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.
- Specified by:
getFileStoresin classFileSystem
-
supportedFileAttributeViews
Returns the set of the names of the file attribute views supported by this FileSystem.This file system supports the following views:
- Specified by:
supportedFileAttributeViewsin classFileSystem
-
getPath
Converts a path string, or a sequence of more that when joined form a path string, to a Path.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 than 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's 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.- Specified by:
getPathin classFileSystem- Parameters:
first- the path string or initial part of the path stringmore- additional strings to be joined to form the path string- Throws:
InvalidPathException- if the path string cannot be converted.
-
getPathMatcher
Unsupported.- Specified by:
getPathMatcherin classFileSystem- Parameters:
s- the matcher- Throws:
UnsupportedOperationException- unsupported.IllegalArgumentException- neverPatternSyntaxException- never
-
getUserPrincipalLookupService
Unsupported.- Specified by:
getUserPrincipalLookupServicein classFileSystem- Throws:
UnsupportedOperationException- unsupported.
-
newWatchService
Unsupported.- Specified by:
newWatchServicein classFileSystem- Throws:
UnsupportedOperationException- unsupported.IOException- Never thrown.
-
equals
-
hashCode
-