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

io.committed.speedy.hook.executable.ExecutableManager Maven / Gradle / Ivy

There is a newer version: 0.1.3
Show newest version
package io.committed.speedy.hook.executable;

import static java.util.Objects.requireNonNull;

import java.io.IOException;
import java.nio.file.Path;
import java.util.function.Supplier;
import org.apache.maven.plugin.logging.Log;

/**
 * Created on 02/11/17.
 *
 * @author Reda.Housni-Alaoui
 */
public class ExecutableManager {

  private final Supplier log;

  public ExecutableManager(Supplier log) {
    requireNonNull(log);
    this.log = log;
  }

  /**
   * Get or creates a file then mark it as executable.
   *
   * @param file The file
   * @return the script
   * @throws IOException when the script file could not be accessed
   */
  public Executable getOrCreateExecutableScript(Path file) throws IOException {
    return new DefaultExecutable(log, file);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy