/** * we only create the directory at startup time, even though we bond at deploy time. * * @throws SmartFrogException failure in starting * @throws RemoteException In case of network/rmi error */ @Override public synchronized void sfStart() throws SmartFrogException, RemoteException { super.sfStart(); File directory = getFile(); boolean clean = sfResolve(ATTR_CLEAN_ON_START, false, false); if (directory.exists()) { if (clean) { FileSystem.recursiveDelete(directory); } // it already exists. that may be harmless, but it warns the component to not // delete the directory during termination. delete = false; } directory.mkdirs(); if (!directory.exists() || !directory.isDirectory()) { // whatever it is, don't try and delete it. delete = false; // raise an error. throw new SmartFrogDeploymentException( "Failed to create directory " + directory.getAbsolutePath()); } maybeStartTerminator("Mkdir"); }