code: public static FileStatus replaceScheme(FileStatus st, String replace, String replacement) {
      if (replace != null && replace.equals(replacement)) {
        return st;
      }
      try {
        return new FileStatus(st.getLen(), st.isDir(), st.getReplication(), st.getBlockSize(), st.getModificationTime(),
            st.getAccessTime(), st.getPermission(), st.getOwner(), st.getGroup(), st.isSymlink() ? st.getSymlink() : null,
            replaceScheme(st.getPath(), replace, replacement));
      } catch (IOException ioe) {
        throw new RuntimeException(ioe);
      }
    }
docs: Replace the scheme of the input {@link FileStatus} if it matches the string to replace.