Add timer metrics to {@link DistributedFileSystem#mkdirs(Path, FsPermission)}
439264
public boolean mkdirs(Path f, FsPermission permission) throws IOException {
    try (Closeable context = new TimerContextWithLog(mkdirTimer.time(), "mkdirs", f, permission)) {
      return super.mkdirs (f, permission);
    }
  }
318758
private void addFilesFromDir(File dir) {
    File[] files = dir.listFiles();
    for (int i = 0; i < files.length; i++) {
      if (!files[i].isDirectory()) {
        mFiles.add(files[i]);
      } else if (mRecursive) {
        addFilesFromDir(files[i]);
      }
    }
  }
1144817
public void addWatchDirectory(File dir, List<String> fileExtensions) {
    	List<String> fileExtensionsWithoutDot = new ArrayList<String>(fileExtensions.size());
    	for(String fileExtension : fileExtensions){
    		fileExtensionsWithoutDot.add(removeStartingDotIfPresent(fileExtension));
    	}
    	directoryWatcherDelegate.addWatchDirectory(dir, fileExtensions);
    }
360200
def do_mkdir(self, path):
        """"""
        path = path[0]

        self.n.makeDirectory(self.current_path + path)
        self.dirs = self.dir_complete()
395600
public static void listStatusForLeafDir(FileSystem fs,
      FileStatus pathStatus,
      List<FileStatus> acc) throws IOException {
    if (!pathStatus.isDir())
      return;
    FileStatus[] fileStatusResults = fs.listStatus(pathStatus.getPath());
    if (fileStatusResults == null) {
      throw new IOException("Path does not exist: " + pathStatus.getPath());
    }

    boolean leafDir = true;
    for (FileStatus f : fileStatusResults) {
      if (f.isDir()) {
        leafDir = false;
        listStatusForLeafDir(fs, f, acc);
      }
    }
    if (leafDir) {
      acc.add(pathStatus); // Accumulate leaf dir
    }
  }
298679
@Override
    public Timer timer(String name) {
        return timer(new Metadata(name, MetricType.TIMER));
    }
48026
static void mkdirp(ZooKeeper zookeeper, String znode) throws KeeperException, InterruptedException {
        boolean createPath = false;
        for (String path : pathParts(znode)) {
            if (!createPath) {
                Stat stat = zookeeper.exists(path, false);
                if (stat == null) {
                    createPath = true;
                }
            }
            if (createPath) {
                create(zookeeper, path);
            }
        }
    }
892262
async function copyNewerSingle(srcpath, destpath, opts) {

  let { interval = 1000, verbose = false } = opts

  let stat = await FS.stat(srcpath)
  // Stat and check the filesystem entry type.
  if (stat.isDirectory()) {
    // Directory, ensure destination exists and return.
    let made = await mkdirp(destpath)
    if (verbose && made) { console.log(`${made} - directory created`)}
    return 'dir'
  }
  else if (!stat.isFile()) {
    // Not a file.
    throw new Error("Not supported.")
  }

  let srcmtime = stat.mtime
  let destmtime
  try {
    // Stat destpath and get the mtime.
    destmtime = (await FS.stat(destpath)).mtime
  }
  catch (err) {
    // path does not exist
  }

  if (destmtime !== undefined && srcmtime - destmtime <= interval) {
    // destpath does not exist or mtime is equal, return.
    if (verbose) { console.log(`${srcpath} == ${destpath}`) }
    return false
  }

  // Ensure parent directory exists.
  await mkdirp(`${destpath}/..`)

  // Commence copying.
  let rs = FS.createReadStream(srcpath)
  let ws = FS.createWriteStream(destpath)
  rs.pipe(ws)
  await waitForStreamEnd(ws)

  // Set mtime to be equal to the source file.
  await FS.utimes(destpath, new Date(), stat.mtime)

  if (verbose) { console.log(`${srcpath} -> ${destpath}`) }
  return true
}
1324246
private void addSubDirectory(Path root, Path filePath) throws IOException {
        String listener = getListenerRootPath(root);

        List<String> listeners = mSubDirectories.get(listener);

        if (listeners != null) {
            if (mSubDirectories.get(listener).contains(filePath.toAbsolutePath())) {
                return;
            } else {
                mSubDirectories.get(listener).add(filePath.toString());
            }

            try {
                watchDir(filePath.toFile());
            } catch (IOException e) {
                throw new IOException("Could not watch the subdirectories.", e);
            }
        }
    }
310185
private static void mkDirs(ChannelSftp channelSftp, String path) {
//		System.err.println("### CREATE SFTP-PATH: " + path);
		int lastSepPos = path.lastIndexOf('/');
		if (lastSepPos > 0) {
			String parentPath = path.substring(0, lastSepPos);
			mkDirs(channelSftp, parentPath);
		}
		try {
			channelSftp.mkdir(path);
		} catch(SftpException e) {
//			System.err.println("### FAILD TO CREATE PATH FOR: " + path + ", ERROR: " + e.getMessage());			
		}
	}
602846
function addWatcher(dirPath) {
    Debug._l(dirPath);
    /*fs.watchFile(dirPath, function (curr, prev) {
     //        console.log('the current mtime is: ' + curr.mtime);
     //        console.log('the previous mtime was: ' + prev.mtime);

     generateCache(id, dirPath);
     });*/
    var watch = Watcher(dirPath, function (filePath, isModified, isDeleted) {
        if (isModified) {
            Debug._l(generateIdFromFilePath(filePath));
            generateCache(filePath);
        }
        if (isDeleted) {
            removeCache(generateIdFromFilePath(filePath));
        }
    });

    return watch;
}
261099
private void writePathDescriptor(File consoleDir, Set<String> paths) {
        try (PrintWriter writer = new PrintWriter(new FileOutputStream(new File(consoleDir, "jettyconsolepaths.txt")))){
            for (String path : paths) {
                writer.println(path);
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }

    }
196139
public void setPermission (Path f, final FsPermission permission) throws IOException {
    try (Closeable context = new TimerContextWithLog(this.setPermissionTimer.time(), "setPermission", f, permission)) {
      super.setPermission(f, permission);
    }
  }
63729
public void addWatchDirectory(File dir, String extension) {
        extension = removeStartingDotIfPresent(extension);
        List<String> fileExtensions = new ArrayList<String>();
        if (extension != null && extension.length() > 0) {
            int i = extension.lastIndexOf('.');
            if(i > -1) {
                extension = extension.substring(i + 1);
            }
            fileExtensions.add(extension);
        }
        else {
            fileExtensions.add("*");
        }
        addWatchDirectory(dir, fileExtensions);
    }
990438
public void logMkDir(String path, INode newNode) {
    MkdirOp op = MkdirOp.getInstance();
    op.set(newNode.getId(), path, newNode.getModificationTime(), 
        newNode.getPermissionStatus());
    logEdit(op);
  }
487450
private static int listDFSPaths()
  {
    Date alpha = new Date();
    int inodeCount = 0;

    String basePath = new String(TEST_BASE_DIR) + "/" + hostName_ + "_" + processName_;
    Queue<String> pending = new LinkedList<String>();
    pending.add(basePath);

    while (!pending.isEmpty()) {
      String parent = pending.remove();
      try {
      	
	  		long startTime = System.nanoTime();
        FileStatus[] children = dfsClient_.listPaths(parent);
        timingListPaths_.add(new Double((System.nanoTime() - startTime)/(1E9)));

        if (children == null || children.length == 0) {
          continue;
        }
        
        for (int i = 0; i < children.length; i++) {
        	String localName = children[i].getPath().getName();
        	if (localName.equals(".") || localName.equals("..")) {
        		continue;
        	}
        	inodeCount ++;
        	if (inodeCount % COUNT_INCR == 0) {
        		System.out.printf("Readdir paths so far: %d\n", inodeCount);
        	}
        	if (children[i].isDir()) {
        		pending.add(parent + "/" + localName);
        	} else {
        		files_.put(parent + "/" + localName, null);
        	}
        }
      } catch (IOException e) {
        e.printStackTrace();
        return -1;
      }
    }

    Date zigma = new Date();
    System.out.printf("Client: Directory walk done over %d inodes in %d msec\n",
    		inodeCount, timeDiffMilliSec(alpha, zigma));
    return 0;
  }
298755
@Override
    public SortedMap<String, Timer> getTimers(MetricFilter filter) {
        return getMetrics(Timer.class, filter);
    }