below the code I am using to read the file
Map<String, InputStream> allFiles = this.storageService.getObjectsInDirectory(path, bucket);
It is reading files from all directories and its subdirectories only want to read files from the directory only.