From dac0c124a5f5e63f0fa46f5e44301732cfe3f273 Mon Sep 17 00:00:00 2001 From: Miller Wang Date: Sun, 22 Oct 2023 22:33:36 +0800 Subject: [PATCH] fix resource type name of blob file/share file. --- .../microsoft/azure/toolkit/lib/storage/blob/BlobFile.java | 6 ++++++ .../azure/toolkit/lib/storage/share/ShareFile.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/blob/BlobFile.java b/azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/blob/BlobFile.java index a900a51ad..142c1ded5 100644 --- a/azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/blob/BlobFile.java +++ b/azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/blob/BlobFile.java @@ -115,4 +115,10 @@ public BlobContainer getContainer() { public boolean isDirectory() { return this.remoteOptional().map(r -> BooleanUtils.isTrue(r.isPrefix())).orElse(false); } + + @Nonnull + @Override + public String getResourceTypeName() { + return isDirectory() ? "Directory" : super.getResourceTypeName(); + } } diff --git a/azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/share/ShareFile.java b/azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/share/ShareFile.java index 626724e8b..23d607b09 100644 --- a/azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/share/ShareFile.java +++ b/azure-toolkit-libs/azure-toolkit-storage-lib/src/main/java/com/microsoft/azure/toolkit/lib/storage/share/ShareFile.java @@ -126,4 +126,10 @@ public String getUrl() { } return this.isDirectory() ? parentClient.getSubdirectoryClient(this.getName()).getDirectoryUrl() : parentClient.getFileClient(this.getName()).getFileUrl(); } + + @Nonnull + @Override + public String getResourceTypeName() { + return isDirectory() ? "Directory" : super.getResourceTypeName(); + } }