code: public boolean rename(Path src, Path dst) throws IOException {
      if (fs.isDirectory(src)) {
        return fs.rename(src, dst);
      } else {
  
        boolean value = fs.rename(src, dst);
        if (!value)
          return false;
  
        Path checkFile = getChecksumFile(src);
        if (fs.exists(checkFile)) { //try to rename checksum
          if (fs.isDirectory(dst)) {
            value = fs.rename(checkFile, dst);
          } else {
            value = fs.rename(checkFile, getChecksumFile(dst));
          }
        }
  
        return value;
      }
    }
docs: Rename files/dirs