public Which(Context context) { super(context); // initialize with system environment PATHs this.paths = ConfigHelper.systemEnvironmentPaths(); }
public DefaultContext() { super(null, null, null, ConfigHelper.create(null)); }
@Override public String prompt(String prompt, Object... args) { verifyHasNextAnswer(prompt); return this.answers.remove(); }
public void configure() { if (detectedScriptFile == null) { locate(); } Path configFile = null; // a script may not actually have been detected if (this.detectedScriptFile != null) { configFile = ConfigHelper.path(detectedBaseDir, detectedScriptFile); scriptExtension = FileHelper.fileExtension(detectedScriptFile); } config = ConfigHelper.create(configFile); context = new ContextImpl( (detectedBaseDir != null ? detectedBaseDir : null), null, detectedScriptFile, config); ContextHolder.set(context); }
static public boolean addClassPath(ClassLoader classLoader, Path path) { return addClassPath(classLoader, path.toUri()); }
static public String fileExtension(File file) { return fileExtension(file.toPath()); }
public Builder() { this.scriptFileLocator = new DefaultScriptFileLocator(); this.dependencyResolver = DependencyResolvers.load(); }
static public File resourceAsFile(String resourceName) throws URISyntaxException, MalformedURLException, IOException { return resourceAsPath(resourceName).toFile(); }
@Override public Path withBaseDir(File file) { Objects.requireNonNull(file, "file cannot be null"); return this.withBaseDir(file.toPath()); }
@Override public Path withUserDir(File file) { Objects.requireNonNull(file, "file cannot be null"); return this.withUserDir(file.toPath()); }
public void configure() { if (detectedScriptFile == null) { locate(); } Path configFile = null; // a script may not actually have been detected if (this.detectedScriptFile != null) { configFile = ConfigHelper.path(detectedBaseDir, detectedScriptFile); scriptExtension = FileHelper.fileExtension(detectedScriptFile); } config = ConfigHelper.create(configFile); context = new ContextImpl( (detectedBaseDir != null ? detectedBaseDir : null), null, detectedScriptFile, config); ContextHolder.set(context); }
static public boolean addClassPath(ClassLoader classLoader, Path path) { return addClassPath(classLoader, path.toUri()); }
static public String fileExtension(File file) { return fileExtension(file.toPath()); }
public Which(Context context) { super(context); // initialize with system environment PATHs this.paths = ConfigHelper.systemEnvironmentPaths(); }
public DefaultContext() { super(null, null, null, ConfigHelper.create(null)); }
@Override public String prompt(String prompt, Object... args) { verifyHasNextAnswer(prompt); return this.answers.remove(); }
public Builder() { this.scriptFileLocator = new DefaultScriptFileLocator(); this.dependencyResolver = DependencyResolvers.load(); }
static public File resourceAsFile(String resourceName) throws URISyntaxException, MalformedURLException, IOException { return resourceAsPath(resourceName).toFile(); }
static public boolean addClassPath(ClassLoader classLoader, File file) { return addClassPath(classLoader, file.toURI()); }
static public boolean addClassPath(ClassLoader classLoader, File file) { return addClassPath(classLoader, file.toURI()); }