/** * Returns the current working directory. * * @return a File for the current working directory. * * @since 1.7.1 */ public static File getCurrentWorkingDir() { return FileUtil.getCwd(); }
public String getBattlePath() { if (battlePath == null) { battlePath = System.getProperty("BATTLEPATH"); if (battlePath == null) { battlePath = "battles"; } battlePath = new File(FileUtil.getCwd(), battlePath).getAbsolutePath(); } return battlePath; }
public void showHelpApi() { showInBrowser( "file://" + new File(FileUtil.getCwd(), "").getAbsoluteFile() + File.separator + "javadoc" + File.separator + "index.html"); }
public void showHelpApi() { String helpurl = "file:" + new File(FileUtil.getCwd(), "").getAbsoluteFile() + File.separator + "javadoc" + File.separator + "index.html"; try { BrowserManager.openURL(helpurl); } catch (IOException e) { JOptionPane.showMessageDialog(this, e.getMessage(), "Unable to open browser!", JOptionPane.INFORMATION_MESSAGE); } }
public void showVersionsTxt() { showInBrowser("file://" + new File(FileUtil.getCwd(), "").getAbsoluteFile() + File.separator + "versions.md"); }
public void showReadMe() { showInBrowser("file://" + new File(FileUtil.getCwd(), "ReadMe.html").getAbsoluteFile()); }
pb.directory(FileUtil.getCwd()); pb.redirectErrorStream(true); // we can use p.getInputStream() Process p = pb.start();
public static void initContainerForRobocodeEngine(File robocodeHome, IBattleListener listener) { try { if (robocodeHome == null) { robocodeHome = FileUtil.getCwd(); } FileUtil.setCwd(robocodeHome); File robotsDir = FileUtil.getRobotsDir(); if (robotsDir == null) { throw new RuntimeException("No valid robot directory is specified"); } else if (!(robotsDir.exists() && robotsDir.isDirectory())) { throw new RuntimeException('\'' + robotsDir.getAbsolutePath() + "' is not a valid robot directory"); } } catch (IOException e) { System.err.println(e); return; } // here we cross transition to EngineClassLoader classes using interface which is defined in system classLoader RobocodeMainBase main = Container.getComponent(RobocodeMainBase.class); main.initForRobocodeEngine(listener); } }
File dir = FileUtil.getCwd();
File f = new File(FileUtil.getCwd(), templateName); int size = (int) (f.length()); byte buff[] = new byte[size]; template = new String(buff); } catch (IOException e) { template = "Unable to read template file: " + FileUtil.getCwd() + File.separatorChar + templateName; } finally { FileUtil.cleanupStream(fis);
public void runIntroBattle() { final File intro = new File(FileUtil.getCwd(), "battles/intro.battle"); if (intro.exists()) { battleManager.setBattleFilename(intro.getPath()); battleManager.loadBattleProperties(); final boolean origShowResults = showResults; // save flag for showing the results showResults = false; try { battleManager.startNewBattle(battleManager.loadBattleProperties(), true, false); battleManager.setDefaultBattleProperties(); robocodeFrame.afterIntroBattle(); } finally { showResults = origShowResults; // always restore the original flag for showing the results } } }
File f = new File(FileUtil.getCwd(), templateName); int size = (int) (f.length()); byte buff[] = new byte[size]; template = new String(buff); } catch (IOException e) { template = "Unable to read template file: " + FileUtil.getCwd() + File.separatorChar + templateName; } finally { FileUtil.cleanupStream(fis);
pb.directory(FileUtil.getCwd()); Process p = pb.start();