manika137 commented on code in PR #8229: URL: https://github.com/apache/hadoop/pull/8229#discussion_r2838979474
########## hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/contracts/services/ContainerListEntrySchema.java: ########## @@ -0,0 +1,286 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.fs.azurebfs.contracts.services; + +import java.util.HashMap; +import java.util.Map; + +/** + * List result entry schema for the Azure Blob Storage List Containers API. + * + * Represents a single container and its associated properties returned by + * the Blob endpoint container listing operation. + */ +public class ContainerListEntrySchema implements ListResultEntrySchema { + + private String name; + private String version; + private Boolean deleted = false; + private Long lastModified; + private String eTag; + private String leaseStatus; + private String leaseState; + private String leaseDuration; + private String publicAccess; + private Boolean hasImmutabilityPolicy; + private Boolean hasLegalHold; + private Long deletedTime; + private Integer remainingRetentionDays; + + private final Map<String, String> metadata = new HashMap<>(); + + /** + * {@inheritDoc} + */ + @Override + public String name() { + return name; + } + + /** + * {@inheritDoc} + * + * Containers are treated as directories in ABFS semantics. + */ + @Override + public Boolean isDirectory() { + return Boolean.TRUE; + } + + /** + * {@inheritDoc} + */ + @Override + public String eTag() { + return eTag; + } + + /** + * {@inheritDoc} + * + * Returns the container last-modified time as a string, if available. + */ + @Override + public String lastModified() { + return lastModified != null ? String.valueOf(lastModified) : null; Review Comment: nit: we can use Objects.toString(lastModified, null) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
