Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -981,17 +981,31 @@ PagedFlux<ShareFileItem> listFilesAndDirectoriesWithOptionalTimeout(ShareListFil
= options == null ? new ShareListFilesAndDirectoriesOptions() : options;

List<ListFilesIncludeType> includeTypes = new ArrayList<>();
if (modifiedOptions.includeAttributes()) {
includeTypes.add(ListFilesIncludeType.ATTRIBUTES);
}
if (modifiedOptions.includeETag()) {
includeTypes.add(ListFilesIncludeType.ETAG);
}
if (modifiedOptions.includeTimestamps()) {
includeTypes.add(ListFilesIncludeType.TIMESTAMPS);
}
if (modifiedOptions.includePermissionKey()) {
includeTypes.add(ListFilesIncludeType.PERMISSION_KEY);

if (modifiedOptions.includeAll()) {
includeTypes.add(ListFilesIncludeType.ALL);
} else {
if (modifiedOptions.includeAttributes()) {
includeTypes.add(ListFilesIncludeType.ATTRIBUTES);
}
if (modifiedOptions.includeETag()) {
includeTypes.add(ListFilesIncludeType.ETAG);
}
if (modifiedOptions.includeTimestamps()) {
includeTypes.add(ListFilesIncludeType.TIMESTAMPS);
}
if (modifiedOptions.includePermissionKey()) {
includeTypes.add(ListFilesIncludeType.PERMISSION_KEY);
}
if (modifiedOptions.includeLinkCount()) {
includeTypes.add(ListFilesIncludeType.LINK_COUNT);
}
if (modifiedOptions.includePermissions()) {
includeTypes.add(ListFilesIncludeType.PERMISSIONS);
}
if (modifiedOptions.includeNfsAttributes()) {
includeTypes.add(ListFilesIncludeType.NFS_ATTRIBUTES);
}
}

// these options must be absent from request if empty or false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.azure.core.util.Context;
import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.serializer.TypeReference;
import com.azure.storage.common.StorageSharedKeyCredential;
import com.azure.storage.common.implementation.SasImplUtils;
import com.azure.storage.common.implementation.StorageImplUtils;
Expand Down Expand Up @@ -56,6 +57,7 @@
import com.azure.storage.file.share.options.ShareFileRenameOptions;
import com.azure.storage.file.share.options.ShareListFilesAndDirectoriesOptions;
import com.azure.storage.file.share.sas.ShareServiceSasSignatureValues;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.time.Duration;
import java.util.ArrayList;
Expand Down Expand Up @@ -947,17 +949,31 @@ public PagedIterable<ShareFileItem> listFilesAndDirectories(ShareListFilesAndDir
= options == null ? new ShareListFilesAndDirectoriesOptions() : options;

List<ListFilesIncludeType> includeTypes = new ArrayList<>();
if (modifiedOptions.includeAttributes()) {
includeTypes.add(ListFilesIncludeType.ATTRIBUTES);
}
if (modifiedOptions.includeETag()) {
includeTypes.add(ListFilesIncludeType.ETAG);
}
if (modifiedOptions.includeTimestamps()) {
includeTypes.add(ListFilesIncludeType.TIMESTAMPS);
}
if (modifiedOptions.includePermissionKey()) {
includeTypes.add(ListFilesIncludeType.PERMISSION_KEY);

if (modifiedOptions.includeAll()) {
includeTypes.add(ListFilesIncludeType.ALL);
} else {
if (modifiedOptions.includeAttributes()) {
includeTypes.add(ListFilesIncludeType.ATTRIBUTES);
}
if (modifiedOptions.includeETag()) {
includeTypes.add(ListFilesIncludeType.ETAG);
}
if (modifiedOptions.includeTimestamps()) {
includeTypes.add(ListFilesIncludeType.TIMESTAMPS);
}
if (modifiedOptions.includePermissionKey()) {
includeTypes.add(ListFilesIncludeType.PERMISSION_KEY);
}
if (modifiedOptions.includeLinkCount()) {
includeTypes.add(ListFilesIncludeType.LINK_COUNT);
}
if (modifiedOptions.includePermissions()) {
includeTypes.add(ListFilesIncludeType.PERMISSIONS);
}
if (modifiedOptions.includeNfsAttributes()) {
includeTypes.add(ListFilesIncludeType.NFS_ATTRIBUTES);
}
}

// these options must be absent from request if empty or false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.storage.file.share.implementation.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.azure.xml.XmlReader;
import com.azure.xml.XmlSerializable;
import com.azure.xml.XmlToken;
import com.azure.xml.XmlWriter;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;

/**
* A listed block device item.
*/
@Fluent
public final class BlockDeviceItem implements XmlSerializable<BlockDeviceItem> {
/*
* The Name property.
*/
@Generated
private StringEncoded name;

/*
* The FileId property.
*/
@Generated
private String fileId;

/*
* File properties.
*/
@Generated
private FileProperty properties;

/*
* The LinkCount property.
*/
@Generated
private Long linkCount;

/*
* The DeviceMajor property.
*/
@Generated
private Long deviceMajor;

/*
* The DeviceMinor property.
*/
@Generated
private Long deviceMinor;

/**
* Creates an instance of BlockDeviceItem class.
*/
@Generated
public BlockDeviceItem() {
}

/**
* Get the name property: The Name property.
*
* @return the name value.
*/
@Generated
public StringEncoded getName() {
return this.name;
}

/**
* Set the name property: The Name property.
*
* @param name the name value to set.
* @return the BlockDeviceItem object itself.
*/
@Generated
public BlockDeviceItem setName(StringEncoded name) {
this.name = name;
return this;
}

/**
* Get the fileId property: The FileId property.
*
* @return the fileId value.
*/
@Generated
public String getFileId() {
return this.fileId;
}

/**
* Set the fileId property: The FileId property.
*
* @param fileId the fileId value to set.
* @return the BlockDeviceItem object itself.
*/
@Generated
public BlockDeviceItem setFileId(String fileId) {
this.fileId = fileId;
return this;
}

/**
* Get the properties property: File properties.
*
* @return the properties value.
*/
@Generated
public FileProperty getProperties() {
return this.properties;
}

/**
* Set the properties property: File properties.
*
* @param properties the properties value to set.
* @return the BlockDeviceItem object itself.
*/
@Generated
public BlockDeviceItem setProperties(FileProperty properties) {
this.properties = properties;
return this;
}

/**
* Get the linkCount property: The LinkCount property.
*
* @return the linkCount value.
*/
@Generated
public Long getLinkCount() {
return this.linkCount;
}

/**
* Set the linkCount property: The LinkCount property.
*
* @param linkCount the linkCount value to set.
* @return the BlockDeviceItem object itself.
*/
@Generated
public BlockDeviceItem setLinkCount(Long linkCount) {
this.linkCount = linkCount;
return this;
}

/**
* Get the deviceMajor property: The DeviceMajor property.
*
* @return the deviceMajor value.
*/
@Generated
public Long getDeviceMajor() {
return this.deviceMajor;
}

/**
* Set the deviceMajor property: The DeviceMajor property.
*
* @param deviceMajor the deviceMajor value to set.
* @return the BlockDeviceItem object itself.
*/
@Generated
public BlockDeviceItem setDeviceMajor(Long deviceMajor) {
this.deviceMajor = deviceMajor;
return this;
}

/**
* Get the deviceMinor property: The DeviceMinor property.
*
* @return the deviceMinor value.
*/
@Generated
public Long getDeviceMinor() {
return this.deviceMinor;
}

/**
* Set the deviceMinor property: The DeviceMinor property.
*
* @param deviceMinor the deviceMinor value to set.
* @return the BlockDeviceItem object itself.
*/
@Generated
public BlockDeviceItem setDeviceMinor(Long deviceMinor) {
this.deviceMinor = deviceMinor;
return this;
}

@Generated
@Override
public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException {
return toXml(xmlWriter, null);
}

@Generated
@Override
public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException {
rootElementName = rootElementName == null || rootElementName.isEmpty() ? "BlockDevice" : rootElementName;
xmlWriter.writeStartElement(rootElementName);
xmlWriter.writeXml(this.name, "Name");
xmlWriter.writeStringElement("FileId", this.fileId);
xmlWriter.writeXml(this.properties, "Properties");
xmlWriter.writeNumberElement("LinkCount", this.linkCount);
xmlWriter.writeNumberElement("DeviceMajor", this.deviceMajor);
xmlWriter.writeNumberElement("DeviceMinor", this.deviceMinor);
return xmlWriter.writeEndElement();
}

/**
* Reads an instance of BlockDeviceItem from the XmlReader.
*
* @param xmlReader The XmlReader being read.
* @return An instance of BlockDeviceItem if the XmlReader was pointing to an instance of it, or null if it was
* pointing to XML null.
* @throws XMLStreamException If an error occurs while reading the BlockDeviceItem.
*/
@Generated
public static BlockDeviceItem fromXml(XmlReader xmlReader) throws XMLStreamException {
return fromXml(xmlReader, null);
}

/**
* Reads an instance of BlockDeviceItem from the XmlReader.
*
* @param xmlReader The XmlReader being read.
* @param rootElementName Optional root element name to override the default defined by the model. Used to support
* cases where the model can deserialize from different root element names.
* @return An instance of BlockDeviceItem if the XmlReader was pointing to an instance of it, or null if it was
* pointing to XML null.
* @throws XMLStreamException If an error occurs while reading the BlockDeviceItem.
*/
@Generated
public static BlockDeviceItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException {
String finalRootElementName
= rootElementName == null || rootElementName.isEmpty() ? "BlockDevice" : rootElementName;
return xmlReader.readObject(finalRootElementName, reader -> {
BlockDeviceItem deserializedBlockDeviceItem = new BlockDeviceItem();
while (reader.nextElement() != XmlToken.END_ELEMENT) {
QName elementName = reader.getElementName();

if ("Name".equals(elementName.getLocalPart())) {
deserializedBlockDeviceItem.name = StringEncoded.fromXml(reader, "Name");
} else if ("FileId".equals(elementName.getLocalPart())) {
deserializedBlockDeviceItem.fileId = reader.getStringElement();
} else if ("Properties".equals(elementName.getLocalPart())) {
deserializedBlockDeviceItem.properties = FileProperty.fromXml(reader, "Properties");
} else if ("LinkCount".equals(elementName.getLocalPart())) {
deserializedBlockDeviceItem.linkCount = reader.getNullableElement(Long::parseLong);
} else if ("DeviceMajor".equals(elementName.getLocalPart())) {
deserializedBlockDeviceItem.deviceMajor = reader.getNullableElement(Long::parseLong);
} else if ("DeviceMinor".equals(elementName.getLocalPart())) {
deserializedBlockDeviceItem.deviceMinor = reader.getNullableElement(Long::parseLong);
} else {
reader.skipElement();
}
}

return deserializedBlockDeviceItem;
});
}
}
Loading
Loading