@Nullable
    public ResourceDescriptor getParent() {
        if (parentFolders.isEmpty()) {
            return null;
        }

        String parentFolderName = parentFolders.get(parentFolders.size() - 1);
        return new ResourceDescriptor(type, parentFolderName,
                parentFolders.subList(0, parentFolders.size() - 1), bucketName, bucketLocation, true);
    }
Returns the parent resource if any.
storage/src/main/java/com/epam/aidial/core/storage/resource/ResourceDescriptor.java