none
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?

    Question

  • 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
            System.out.println(uri);
           }
       }  
    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");
    System.out.println("listObjectRequest:"+listObjectRequest);
    ObjectListing objects = s3Client.listObjects(listObjectRequest); // bucket.getName());
    System.out.println("objects:"+objects);
    for (S3ObjectSummary objectSummary : objects.getObjectSummaries()) 
               {
    String objectKey = objectSummary.getKey();
    if (objectKey.contains(".jpg") {
                       continue;
                   } else {
                    System.out.println("objectKey::::"+objectKey);}

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

Answers

All replies