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

com.github.dakusui.actionunit.actions.cmd.unix.Touch Maven / Gradle / Ivy

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

import com.github.dakusui.actionunit.actions.cmd.Commander;
import com.github.dakusui.actionunit.actions.cmd.CommanderConfig;
import com.github.dakusui.actionunit.core.Context;

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

import static java.util.Objects.requireNonNull;

public class Touch extends Commander {
  public Touch(CommanderConfig initializer) {
    super(initializer, "touch");
  }

  public Touch noCreate() {
    return this.addOption("-c");
  }

  public Touch file(String file) {
    return this.add(file);
  }

  public Touch file(File file) {
    return this.file(requireNonNull(file).getAbsolutePath());
  }

  public Touch file(Function file) {
    return this.add(requireNonNull(file));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy