software.amazon.nio.spi.s3.S3FileAttributeView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-nio-spi-for-s3 Show documentation
Show all versions of aws-java-nio-spi-for-s3 Show documentation
A Java NIO.2 service provider for S3, allowing Java NIO operations to be performed on paths using the `s3` scheme. This
package implements the service provider interface (SPI) defined for Java NIO.2 in JDK 1.7 providing "plug-in" non-blocking
access to S3 objects for Java applications using Java NIO.2 for file access.
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package software.amazon.nio.spi.s3;
import java.nio.file.attribute.BasicFileAttributeView;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
public class S3FileAttributeView implements BasicFileAttributeView {
private final S3Path path;
protected S3FileAttributeView(S3Path path){
this.path = path;
}
/**
* Returns the name of the attribute view. Attribute views of this type
* have the name {@code "basic"}.
*/
@Override
public String name() {
return "s3";
}
/**
* Reads the basic file attributes as a bulk operation.
*
* It is implementation specific if all file attributes are read as an
* atomic operation with respect to other file system operations.
*
* @return the file attributes
*/
@Override
public BasicFileAttributes readAttributes() {
return new S3BasicFileAttributes(path);
}
/**
* Unsupported operation, write operations are not supported.
*/
@Override
public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime) {
throw new UnsupportedOperationException("write operations are not supported, please submitted a feature request explaining your use case");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy