com.github.dakusui.actionunit.linux.Rm 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.linux;
import com.github.dakusui.actionunit.actions.cmd.Commander;
import com.github.dakusui.actionunit.core.Context;
import java.io.File;
import java.util.function.Function;
import static java.util.Objects.requireNonNull;
public class Rm extends Commander {
public Rm() {
super();
}
public Rm recursive() {
return this.add("-r");
}
public Rm force() {
return this.add("-f");
}
public Rm file(File file) {
return this.file(requireNonNull(file).getAbsolutePath());
}
public Rm file(String file) {
return this.addq(file);
}
public Rm file(Function file) {
return this.addq(file);
}
@Override
protected String program() {
return "/bin/rm";
}
}