/**
   * Return an array containing hostnames, offset and size of portions of the given file. For a
   * nonexistent file or regions, null will be returned.
   *
   * <p>This call is most helpful with DFS, where it returns hostnames of machines that contain the
   * given file.
   *
   * <p>The FileSystem will simply return an elt containing 'localhost'.
   */
  @Override
  public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len)
      throws IOException {
    // Check if requested file in Swift is more than 5Gb. In this case
    // each block has its own location -which may be determinable
    // from the Swift client API, depending on the remote server

    final FileStatus[] listOfFileBlocks = store.listSubPaths(file.getPath());
    List<URI> locations = new ArrayList<URI>();
    if (listOfFileBlocks.length > 1) {
      for (FileStatus fileStatus : listOfFileBlocks) {
        if (SwiftObjectPath.fromPath(uri, fileStatus.getPath())
            .equals(SwiftObjectPath.fromPath(uri, file.getPath()))) {
          continue;
        }
        if (fileStatus.getPath() != null) {
          locations.addAll(store.getObjectLocation(fileStatus.getPath()));
        }
      }
    } else {
      locations = store.getObjectLocation(file.getPath());
    }

    final String[] names = new String[locations.size()];
    final String[] hosts = new String[locations.size()];
    int i = 0;
    for (URI location : locations) {
      hosts[i] = location.getHost();
      names[i] = location.getAuthority();
      i++;
    }
    return new BlockLocation[] {new BlockLocation(names, hosts, 0, file.getLen())};
  }