All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dakusui.actionunit.actions.cmd.linux.Mkdir Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package com.github.dakusui.actionunit.actions.cmd.linux;

import com.github.dakusui.actionunit.actions.cmd.Commander;
import com.github.dakusui.actionunit.core.context.ContextFunction;

import java.io.File;
import java.util.function.IntFunction;

import static java.util.Objects.requireNonNull;

public class Mkdir extends Commander {
  public Mkdir(IntFunction parameterPlaceHolderFormatter) {
    super(parameterPlaceHolderFormatter);
    this.command("mkdir");
  }

  public Mkdir recursive() {
    return this.addOption("-p");
  }

  public Mkdir dir(String path) {
    return this.add(path);
  }

  public Mkdir dir(File path) {
    return this.dir(requireNonNull(path).getAbsolutePath());
  }

  public Mkdir dir(ContextFunction path) {
    return this.add(requireNonNull(path));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy