com.github.dakusui.actionunit.actions.cmd.linux.Mkdir Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of actionunit Show documentation
Show all versions of actionunit Show documentation
A library to build 'action' structure for testing
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));
}
}