public ResourceDescriptor resolveByUrl(String url) {
        String prefix = type.group() + PATH_SEPARATOR + bucketName  + PATH_SEPARATOR;
        if (!isFolder) {
            throw new IllegalStateException("Resource must be a folder");
        }
        if (!url.startsWith(prefix)) {
            throw new IllegalArgumentException("Incompatible description and absolute path");
        }

        String relativePath = url.substring(prefix.length());

        String[] encodedSegments = relativePath.split(ResourceDescriptor.PATH_SEPARATOR);
        List<String> segments = Arrays.stream(encodedSegments).map(UrlUtil::decodePath).toList();

        boolean isEmptySegments = segments.isEmpty();
        String name = isEmptySegments ? null : segments.get(segments.size() - 1);
        List<String> parentFolders = isEmptySegments ? List.of() : segments.subList(0, segments.size() - 1);

        boolean isFolder = UrlUtil.isFolder(url);
        return new ResourceDescriptor(type, name, parentFolders, bucketName, bucketLocation, isFolder);
    }
If the current resource is a folder the method tries to resolve the given URL to a new resource.

@param url - to the resource with encrypted bucket
storage/src/main/java/com/epam/aidial/core/storage/resource/ResourceDescriptor.java