String lineRead = null; Process seedProc = Runtime.getRuntime().exec(cmdString); BufferedReader reader = new BufferedReader(new InputStreamReader(seedProc.getInputStream())); while((lineRead = reader.readLine()) != null) { if (logger.isDebugEnabled()) { logger.debug("finishPage(IProgressMonitor)" + lineRead);
String lineRead = null; Process seedProc = Runtime.getRuntime().exec(cmdString); BufferedReader reader = new BufferedReader( new InputStreamReader(seedProc.getInputStream())); while ((lineRead = reader.readLine()) != null) { if (logger.isDebugEnabled()) { logger.debug("finishPage(IProgressMonitor)" + lineRead); }
	private void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {		if (monitor == null) {			monitor= new NullProgressMonitor();		}				int exitValue = -1;		try {					String strName = page.getProjectName();			monitor.beginTask("Creating "+ strName + " Forrest Project", 3);			IProject project= page.getProjectHandle();			IPath locationPath= page.getLocationPath();					// create the project			IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName());			if (!page.useDefaults()) {				desc.setLocation(locationPath);			}			project.create(desc, new SubProgressMonitor(monitor, 1));			project.open(new SubProgressMonitor(monitor, 1));						// seed the project			ForrestPlugin plugin = ForrestPlugin.getDefault();						String strPath = locationPath.toOSString();			String cmdString =  null;						if (System.getProperty("os.name").toLowerCase().startsWith("linux")) {				cmdString = "forrest -Dbasedir=" + strPath + "/" + strName						+ " seed";			} else if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {				cmdString = "cmd /c forrest -Dbasedir=" + strPath + "\\" + strName						+ " seed";			}						try {		      String lineRead = null;			  Process seedProc = Runtime.getRuntime().exec(cmdString);		      BufferedReader reader = new BufferedReader(new InputStreamReader(seedProc.getInputStream()));		      while((lineRead = reader.readLine()) != null) {				if (logger.isDebugEnabled()) {					logger.debug("finishPage(IProgressMonitor)" + lineRead);				}              }			  exitValue = seedProc.exitValue();			} catch (IOException e) {				// TODO Auto-generated catch block				logger.error("finishPage(IProgressMonitor)", e);			}						project.refreshLocal(IProject.DEPTH_INFINITE, monitor);						if (pluginPage.getActivateViewValue()) {				Utilities.activateForrestProperty(strPath + "\\" + strName +  "\\forrest.properties" ,"project.skin=leather-dev");				Utilities.addForrestPluginProperty(strPath + "\\" + strName +  "\\forrest.properties","org.apache.forrest.plugin.output.viewHelper.xhtml,org.apache.forrest.plugin.internal.view");			}			Utilities.addForrestPluginProperty(strPath + "\\" + strName +  "\\forrest.properties", pluginPage.getSelectedPlugins());						// TODO: change to the perspective specified in the plugin.xml					} finally {			monitor.done();		}	}