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

com.github.dakusui.actionunit.linux.Rm Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
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";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy