code: public boolean moveToWaitingRoom(Path path) throws IOException {
      // Make path absolute
      if (!path.isAbsolute()) path = new Path(dfs.getWorkingDirectory(), path);
  
      // Check if path is valid
      if (!dfs.exists(path)) throw new FileNotFoundException(path.toString());
  
      // Check if file already in waiting area
      String qPath = path.makeQualified(dfs).toString();
      if (qPath.startsWith(WR.toString())) return false;
  
      // Check if trying to move waiting room or its parent dir to 
      // waiting room
      if (WR.toString().startsWith(qPath)) {
        throw new IOException("Can't delete " + path + 
                          " as it contains the waiting room directory.");
      }
  
      String fName = path.getName();
      Path baseWRPath = getWaitingRoomPath(path.getParent());
  
      // Make dir(s) for base
      Stack<Path> parentDirs = new Stack<Path>();
      do {
        parentDirs.push(baseWRPath);
        baseWRPath = baseWRPath.getParent();
      } while (baseWRPath != null);
  
      while (!parentDirs.empty()) {
        baseWRPath = parentDirs.pop();
  
        // Create new dir with appended .WRx if already exists.
        for (int i = 0; dfs.exists(baseWRPath) && !dfs.getFileStatus(baseWRPath).isDir(); i++) {
          baseWRPath = new Path(baseWRPath.toString() + ".WR" + i);
        }
  
        if (!dfs.mkdirs(baseWRPath, PERMISSION)) {
          LOG.warn("Couldn't create base dir path in waiting room for " + baseWRPath);
          return false;
        }
      }
  
      // Rename file/dir to waiting room. Append .WRx if already exists.
      Path myWRPath = new Path(baseWRPath.toString(), fName);
      for (int i = 0; dfs.exists(myWRPath); i++) {
        myWRPath = new Path(myWRPath.toString() + ".WR" + i);
      }
  
      if (dfs.rename(path, myWRPath)) return true; // success
  
      return false;
    }
docs: Moves a file/dir to the waiting room
  
  @param path Path to file/dir
  @return false if move failed, true otherwise