Share via


AzureBasicFileAttributes Class

  • java.lang.Object
    • com.azure.storage.blob.nio.AzureBasicFileAttributes

Implements

public final class AzureBasicFileAttributes
implements BasicFileAttributes

Provides support for basic file attributes.

The properties available on this type are a strict subset of AzureBlobFileAttributes, and the two types have the same network behavior. Therefore, while this type is offered for compliance with the NIO spec, AzureBlobFileAttributes is generally preferred.

Some attributes are not supported. Refer to the javadocs on each method for more information.

If the target file is a virtual directory, most attributes will be set to null.

Method Summary

Modifier and Type Method and Description
FileTime creationTime()

Returns the creation time.

Object fileKey()

Returns the url of the resource.

boolean isDirectory()

Tells whether the file is a directory.

boolean isOther()

Tells whether the file is something other than a regular file, directory, or symbolic link.

boolean isRegularFile()

Tells whether the file is a regular file with opaque content.

boolean isSymbolicLink()

Tells whether the file is a symbolic link.

boolean isVirtualDirectory()

Tells whether the file is a virtual directory.

FileTime lastAccessTime()

Returns the time of last modification or null if this is a virtual directory

FileTime lastModifiedTime()

Returns the time of last modification or null if this is a virtual directory.

long size()

Returns the size of the file (in bytes).

Methods inherited from java.lang.Object

Method Details

creationTime

public FileTime creationTime()

Returns the creation time. The creation time is the time that the file was created. Returns null if this is a virtual directory.

Returns:

The creation time or null if this is a virtual directory

fileKey

public Object fileKey()

Returns the url of the resource.

Returns:

The file key, which is the url.

isDirectory

public boolean isDirectory()

Tells whether the file is a directory.

Will only return true if the directory is a concrete directory. See createDirectory(Path path, FileAttribute<?>[] fileAttributes) for more information on virtual and concrete directories.

Returns:

whether the file is a directory

isOther

public boolean isOther()

Tells whether the file is something other than a regular file, directory, or symbolic link.

Returns:

false. No other object types are supported.

isRegularFile

public boolean isRegularFile()

Tells whether the file is a regular file with opaque content.

Returns:

whether the file is a regular file.

isSymbolicLink

public boolean isSymbolicLink()

Tells whether the file is a symbolic link.

Returns:

false. Symbolic links are not supported.

isVirtualDirectory

public boolean isVirtualDirectory()

Tells whether the file is a virtual directory.

See createDirectory(Path path, FileAttribute<?>[] fileAttributes) for more information on virtual and concrete directories.

Returns:

whether the file is a virtual directory

lastAccessTime

public FileTime lastAccessTime()

Returns the time of last modification or null if this is a virtual directory

Last access time is not supported by the blob service. In this case, it is typical for implementations to return the lastModifiedTime().

Returns:

the time of last modification or null if this is a virtual directory

lastModifiedTime

public FileTime lastModifiedTime()

Returns the time of last modification or null if this is a virtual directory.

Returns:

the time of last modification or null if this is a virtual directory

size

public long size()

Returns the size of the file (in bytes).

Returns:

the size of the file

Applies to