Can we list out the files with the help of Share name and with prefix as done in S3? Do Azure have similar methods? How can we achieve the same in Azure?


  • I have 10K images files are there including jpeg,txt, audio and video files. I want to filter out all the jpeg images. I am filtering the same as 
    for ( ListFileItem fileItem : rootDir.listFilesAndDirectories() ) 
        String uri = fileItem.getUri().toString();
           String pattern = ".jpg";
           // Create a Pattern object
           Pattern r = Pattern.compile(pattern);
           // Now create matcher object.
           Matcher m = r.matcher(uri);
           if (m.find()) 
            //Printing jpeg uri at console
    It is doing the purpose.
    But i want to filter out the same jpeg image file through the Share name and with prefix as done by Amazon S3 cloud.
    For Example: 
    final ListObjectsRequest listObjectRequest = new ListObjectsRequest().withBucketName(bucket.getName()).withPrefix("share11/vantage");
    ObjectListing objects = s3Client.listObjects(listObjectRequest); // bucket.getName());
    for (S3ObjectSummary objectSummary : objects.getObjectSummaries()) 
    String objectKey = objectSummary.getKey();
    if (objectKey.contains(".jpg") {
                   } else {

    How can i achieve same in Azure? Please suggest.
    Tuesday, December 27, 2016 8:35 AM


All replies