code: public static void actionDelete(PageContext pc, Resource dir, boolean forceDelete, String serverPassword) throws PageException {
  	SecurityManager securityManager = pc.getConfig().getSecurityManager();
  	securityManager.checkFileLocation(pc.getConfig(), dir, serverPassword);
  
  	// directory doesn't exist
  	if (!dir.exists()) {
  	    if (dir.isDirectory()) throw new ApplicationException("directory [" + dir.toString() + "] doesn't exist");
  	    else if (dir.isFile()) throw new ApplicationException("file [" + dir.toString() + "] doesn't exist and isn't a directory");
  	}
  
  	// check if file
  	if (dir.isFile()) throw new ApplicationException("can't delete [" + dir.toString() + "], it isn't a directory it is a file");
  
  	// delete directory
  	try {
  	    dir.remove(forceDelete);
  	}
  	catch (IOException e) {
  	    throw Caster.toPageException(e);
  	}
      }
docs: delete directory
  
  @param dir
  @param forceDelete
  @throws PageException