private static String createUniqueTargetResourceUrl(ResourceDescriptor sourceDescriptor, String targetFolderUrl, Map<String, Integer> fileNamesTaken) {
        String fileName = sourceDescriptor.getName();
        int count = fileNamesTaken.getOrDefault(fileName, 0) + 1;
        fileNamesTaken.put(fileName, count);

        if (count > 1) {
            if (sourceDescriptor.isFolder() || !fileName.contains(".")) {
                // File has no extension or folder
                fileName = fileName + "_" + count;
            } else {
                // File has extension
                fileName = fileName.replaceFirst("(\\.[^.]+)$", "_" + count + "$1");
            }
        }

        return ResourceDescriptorFactory.fromDecoded(
                sourceDescriptor.getType(),
                ResourceDescriptor.PUBLIC_BUCKET,
                ResourceDescriptor.PATH_SEPARATOR,
                targetFolderUrl + fileName).getUrl();
    }
Leaves only required fields for listing.
server/src/main/java/com/epam/aidial/core/server/service/PublicationService.java