© 2026 Hedgehog Software, LLC
file.isFile()
public static void start() { try { WatchService watchService = FileSystems.getDefault().newWatchService(); Path scriptsFolder = Paths.get(SCRIPTS_FOLDER); scriptsFolder.register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY ); SkReloader.getLog().info("Started FileWatcher! Scripts folder: '" + SCRIPTS_FOLDER + "'"); while (true) { WatchKey key = watchService.take(); for (WatchEvent<?> event : key.pollEvents()) { WatchEvent.Kind<?> kind = event.kind(); Path path = (Path) event.context(); File file = new File(path.toFile().getAbsolutePath()); // if (!file.toFile().isFile()) return; SkReloader.getLog().info(file + " " + file.getClass()); Script script = ScriptLoader.getScript(file); ...
public static Script getScript(File file) { if (!file.isFile()) throw new IllegalArgumentException("Something other than a file was provided."); ...
Join the Discord to ask follow-up questions and connect with the community
We are a Community full of Java developers. Connect with other devs, get help, help others and do much more!
27,732 Members