Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 14550 invoked from network); 12 Jun 2008 13:29:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jun 2008 13:29:56 -0000 Received: (qmail 17528 invoked by uid 500); 12 Jun 2008 13:29:49 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 17486 invoked by uid 500); 12 Jun 2008 13:29:49 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 17464 invoked by uid 99); 12 Jun 2008 13:29:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2008 06:29:49 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2008 13:29:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E0A7A23889BA; Thu, 12 Jun 2008 06:29:25 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r667079 - /directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/jobs/LaunchServerJob.java Date: Thu, 12 Jun 2008 13:29:25 -0000 To: commits@directory.apache.org From: pamarcelot@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080612132925.E0A7A23889BA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pamarcelot Date: Thu Jun 12 06:29:25 2008 New Revision: 667079 URL: http://svn.apache.org/viewvc?rev=667079&view=rev Log: Fixed a bug with paths containing spaces (or any special character). Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/jobs/LaunchServerJob.java Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/jobs/LaunchServerJob.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/jobs/LaunchServerJob.java?rev=667079&r1=667078&r2=667079&view=diff ============================================================================== --- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/jobs/LaunchServerJob.java (original) +++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/jobs/LaunchServerJob.java Thu Jun 12 06:29:25 2008 @@ -92,11 +92,11 @@ /** * Creates a new instance of LaunchServerJob. - * + * * @param server - * the server + * the server * @param configuration - * the configuration + * the configuration */ public LaunchServerJob( Server server, ServerConfigurationV152 configuration ) { @@ -108,6 +108,7 @@ /* * (non-Javadoc) + * * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ protected IStatus run( IProgressMonitor monitor ) @@ -181,15 +182,16 @@ server.setState( ServerStateEnum.STARTED ); writeToInfoConsoleMessageStream( "Server started.\n" ); - /// ... and we exit the thread + // / ... and we exit the thread return; } catch ( NamingException e ) { - // If we get an exception when trying to create the + // If we get an exception when trying to create the // context, it means the server is not yest started - // We just wait one second before starting the test once again + // We just wait one second before starting the test once + // again try { Thread.sleep( 1000 ); @@ -213,9 +215,9 @@ /** * Creates a context on the server. - * + * * @throws NamingException - * if an error occurs when creating the context + * if an error occurs when creating the context */ private void createInitialDirContext() throws NamingException { @@ -236,9 +238,9 @@ /** * Writes the given message to the Info console message stream. - * + * * @param message - * the message + * the message */ private void writeToInfoConsoleMessageStream( final String message ) { @@ -284,7 +286,8 @@ // Looping on the debug events array for ( DebugEvent debugEvent : events ) { - // We only care of event with kind equals to 'terminate' + // We only care of event with kind equals to + // 'terminate' if ( debugEvent.getKind() == DebugEvent.TERMINATE ) { // Getting the source of the debug event @@ -297,7 +300,8 @@ ILaunch debugEventLaunch = runtimeProcess.getLaunch(); if ( debugEventLaunch.equals( launch ) ) { - // The launch we had created is now terminated + // The launch we had created is now + // terminated // The server is now stopped server.setState( ServerStateEnum.STOPPED ); @@ -352,12 +356,12 @@ /** - * Overwrites the log4j.properties file of the server with the - * given port number. + * Overwrites the log4j.properties file of the server with the given port + * number. * * @param port * the port - * @throws IOException + * @throws IOException */ private void overwriteServersLog4jPropertiesFile( int port ) throws IOException { @@ -413,13 +417,13 @@ IPath serverFolderPath = ApacheDsPluginUtils.getApacheDsServersFolder().append( server.getId() ); // Setting the program arguments attribute - workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, serverFolderPath - .toOSString() ); + workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "\"" + + serverFolderPath.toOSString() + "\"" ); // Creating the VM arguments string StringBuffer vmArguments = new StringBuffer(); - vmArguments.append( "-Dlog4j.configuration=file:" - + serverFolderPath.append( "conf" ).append( "log4j.properties" ).toOSString() ); + vmArguments.append( "-Dlog4j.configuration=file:\"" + + serverFolderPath.append( "conf" ).append( "log4j.properties" ).toOSString() + "\"" ); vmArguments.append( " " ); vmArguments.append( "-Dapacheds.var.dir=\"" + serverFolderPath.toOSString() + "\"" ); vmArguments.append( " " ); @@ -436,7 +440,7 @@ workingCopy.setAttribute( IDebugUIConstants.ATTR_PRIVATE, true ); // Indicating that we don't want any console to show up - workingCopy.setAttribute( DebugPlugin.ATTR_CAPTURE_OUTPUT, false ); + workingCopy.setAttribute( DebugPlugin.ATTR_CAPTURE_OUTPUT, true ); // Saving the launch configuration ILaunchConfiguration configuration = workingCopy.doSave(); @@ -453,9 +457,8 @@ /** * Gets the associated launch. - * - * @return - * the associated launch + * + * @return the associated launch */ public ILaunch getLaunch() { @@ -465,9 +468,9 @@ /** * Sets the logs level. - * + * * @param logsLevel - * the logs level + * the logs level */ public void setLogsLevel( String logsLevel ) { @@ -477,9 +480,9 @@ /** * Sets the logs pattern. - * + * * @param logsPattern - * the logs pattern + * the logs pattern */ public void setLogsPattern( String logsPattern ) {