/** * @param assembleDir directory to copy JAR files to */ private void copyJars(String assembleDir) { FileHandler fileHandler = new DefaultFileHandler(); File f = new File(assembleDir); File webInfLib = new File(f, "WEB-INF/lib"); fileHandler.mkdirs(webInfLib.getAbsolutePath()); for (File sourceFile : this.jarFiles) { fileHandler.copyFile(sourceFile.getAbsolutePath(), new File(webInfLib, sourceFile .getName()).getAbsolutePath()); } }
/** * @param assembleDir directory to copy JAR files to */ private void copyJars(String assembleDir) { FileHandler fileHandler = new DefaultFileHandler(); File f = new File(assembleDir); File webInfLib = new File(f, "WEB-INF/lib"); fileHandler.mkdirs(webInfLib.getAbsolutePath()); for (File sourceFile : this.jarFiles) { fileHandler.copyFile(sourceFile.getAbsolutePath(), new File(webInfLib, sourceFile .getName()).getAbsolutePath()); } }
/** * Creates and returns the password file that contains admin's password. * * @param configuration local configuration. * @return The password file that contains admin's password. */ public static File getPasswordFile(LocalConfiguration configuration) { String password = configuration.getPropertyValue(RemotePropertySet.PASSWORD); if (password == null) { password = ""; } try { File f = new File(configuration.getHome(), "password.properties"); if (!f.exists()) { configuration.getFileHandler().mkdirs(configuration.getHome()); FileWriter w = new FileWriter(f); w.write("AS_ADMIN_PASSWORD=" + password + "\n"); w.close(); } return f; } catch (IOException e) { throw new CargoException("Failed to create a password file", e); } }
/** * Creates and returns the password file that contains admin's password. * * @param configuration local configuration. * @return The password file that contains admin's password. */ public static File getPasswordFile(LocalConfiguration configuration) { String password = configuration.getPropertyValue(RemotePropertySet.PASSWORD); if (password == null) { password = ""; } try { File f = new File(configuration.getHome(), "password.properties"); if (!f.exists()) { configuration.getFileHandler().mkdirs(configuration.getHome()); FileWriter w = new FileWriter(f); w.write("AS_ADMIN_PASSWORD=" + password + "\n"); w.close(); } return f; } catch (IOException e) { throw new CargoException("Failed to create a password file", e); } }
getFileHandler().mkdirs(outputFile); outputFile = getFileHandler().append(outputFile, getDeployableName(originalDeployable));
getFileHandler().mkdirs(outputFile); outputFile = getFileHandler().append(outputFile, getDeployableName(originalDeployable));
if (!getFileHandler().exists(downloadDir)) getFileHandler().mkdirs(downloadDir);
String folder = this.getHome() + "/modules/org/codehaus/cargo/classpath/" + moduleName + "/main"; getFileHandler().mkdirs(folder);
String folder = this.getHome() + "/modules/org/codehaus/cargo/classpath/" + moduleName + "/main"; getFileHandler().mkdirs(folder);
/** * Creates the test file system manager and the container. {@inheritDoc} * @throws Exception If anything goes wrong. */ @Override protected void setUp() throws Exception { super.setUp(); fsManager = new StandardFileSystemManager(); fsManager.init(); fileHandler = new VFSFileHandler(fsManager); String testHome = "ram:/" + this.getClass().getName(); String configHome = testHome + "/config"; String containerHome = testHome + "/container"; fileHandler.mkdirs(configHome); fileHandler.mkdirs(containerHome); this.configuration = createLocalConfiguration(configHome); this.configuration.setFileHandler(fileHandler); this.container = createLocalContainer(configuration); this.container.setHome(containerHome); this.container.setFileHandler(fileHandler); }
getFileHandler().mkdirs(outputFile.getAbsoluteFile().getParent());
getFileHandler().mkdirs(deployDir);
getFileHandler().mkdirs(deployDir);
getFileHandler().mkdirs(getHome());