/** * Current context of execution. Usually bound to a thread local. * @return The current context */ static public Context currentContext() { return ContextHolder.get(); }
/** * Current context of execution. Usually bound to a thread local. * @return The current context */ static public Context currentContext() { return ContextHolder.get(); }
/** * The application base directory. The base directory is the directory * of the script that is executing. So if your script is located at * "/home/joelauer/project/blaze.java" then this baes directory would be * "/home/joelauer/project" * @return The application base directory */ static public Path baseDir() { return ContextHolder.get().baseDir(); }
/** * A logger for the current context. * @return A logger for the current context. Guaranteed to be present. */ static public Logger logger() { return ContextHolder.get().logger(); }
/** * A logger for the current context. * @return A logger for the current context. Guaranteed to be present. */ static public Logger logger() { return ContextHolder.get().logger(); }
/** * The current user's home directory such as "/home/joelauer" or "C:\Users\Joe Lauer". * This method differs from <code>System.getProperty("user.home")</code> by * checking the environment variables HOME and HOMEPATH first. This allows * a program running under something like "sudo" to still correctly find * the actual user's home directory rather than "root". * * @return The current user's home directory */ static public Path userDir() { return ContextHolder.get().userDir(); }
/** * The application configuration * @return The application configuration instance. Guaranteed to be present. */ static public Config config() { return ContextHolder.get().config(); }
/** * The current user's home directory such as "/home/joelauer" or "C:\Users\Joe Lauer". * This method differs from <code>System.getProperty("user.home")</code> by * checking the environment variables HOME and HOMEPATH first. This allows * a program running under something like "sudo" to still correctly find * the actual user's home directory rather than "root". * * @return The current user's home directory */ static public Path userDir() { return ContextHolder.get().userDir(); }
/** * The application base directory. The base directory is the directory * of the script that is executing. So if your script is located at * "/home/joelauer/project/blaze.java" then this baes directory would be * "/home/joelauer/project" * @return The application base directory */ static public Path baseDir() { return ContextHolder.get().baseDir(); }
/** * The application configuration * @return The application configuration instance. Guaranteed to be present. */ static public Config config() { return ContextHolder.get().config(); }
static public Path withUserDir(Path path) { return ContextHolder.get().withUserDir(path); }
static public Path withUserDir(File path) { return ContextHolder.get().withUserDir(path); }
static public Path withUserDir(String path) { return ContextHolder.get().withUserDir(path); }
/** * Resolves a path relative to the base directory. If the path is absolute * it will be returned intact, otherwise it will be appended to the * current base directory. So if your base directory is "/home/joelauer/project" * and you provide a path of "images/my.png" then a path of "/home/joelauer/project/images/my.png" * will be returned * @param path The path to resolve * @return The resolved path * @see #withBaseDir(java.io.File) * @see #withBaseDir(java.lang.String) */ static public Path withBaseDir(Path path) { return ContextHolder.get().withBaseDir(path); }
/** * Resolves a path relative to the base directory. If the path is absolute * it will be returned intact, otherwise it will be appended to the * current base directory. So if your base directory is "/home/joelauer/project" * and you provide a path of "images/my.png" then a path of "/home/joelauer/project/images/my.png" * will be returned * @param path The path to resolve * @return The resolved path * @see #withBaseDir(java.io.File) * @see #withBaseDir(java.lang.String) */ static public Path withBaseDir(Path path) { return ContextHolder.get().withBaseDir(path); }
/** * Resolves a path relative to the base directory. If the path is absolute * it will be returned intact, otherwise it will be appended to the * current base directory. So if your base directory is "/home/joelauer/project" * and you provide a path of "images/my.png" then a path of "/home/joelauer/project/images/my.png" * will be returned * @param path The path to resolve * @return The resolved path * @see #withBaseDir(java.io.File) * @see #withBaseDir(java.lang.String) */ static public Path withBaseDir(String path) { return ContextHolder.get().withBaseDir(path); }
static public char[] passwordPrompt(String prompt, Object... args) { return ContextHolder.get().passwordPrompt(prompt, args); }
/** * Resolves a path relative to the base directory. If the path is absolute * it will be returned intact, otherwise it will be appended to the * current base directory. So if your base directory is "/home/joelauer/project" * and you provide a path of "images/my.png" then a path of "/home/joelauer/project/images/my.png" * will be returned * @param path The path to resolve * @return The resolved path * @see #withBaseDir(java.io.File) * @see #withBaseDir(java.lang.String) */ static public Path withBaseDir(File path) { return ContextHolder.get().withBaseDir(path); }
static public String prompt(String prompt, Object... args) { return ContextHolder.get().prompt(prompt, args); }
static public Path withUserDir(String path) { return ContextHolder.get().withUserDir(path); }