1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

Reformat.

This commit is contained in:
Alain Magloire 2002-10-17 13:59:13 +00:00
parent badcff4119
commit df56cb6372

View file

@ -8,71 +8,66 @@ package org.eclipse.cdt.utils.spawner;
import java.io.File;
import java.io.IOException;
public class ProcessFactory {
static private ProcessFactory instance;
private boolean hasSpawner;
private Runtime runtime;
private ProcessFactory() {
hasSpawner = false;
runtime = Runtime.getRuntime();
try
{
System.loadLibrary( "spawner" );
hasSpawner = true;
}
catch( SecurityException e )
{
}
catch( UnsatisfiedLinkError e )
{
}
}
static private ProcessFactory instance;
private boolean hasSpawner;
private Runtime runtime;
public static ProcessFactory getFactory() {
if( instance == null )
instance = new ProcessFactory();
return instance;
}
private ProcessFactory() {
hasSpawner = false;
runtime = Runtime.getRuntime();
try {
System.loadLibrary("spawner"); //$NON-NLS-1$
hasSpawner = true;
} catch (SecurityException e) {
//e.printStackTrace();
} catch (UnsatisfiedLinkError e) {
//e.printStackTrace();
}
}
public Process exec( String cmd ) throws IOException {
if( hasSpawner )
return new Spawner( cmd );
return runtime.exec( cmd );
}
public static ProcessFactory getFactory() {
if (instance == null)
instance = new ProcessFactory();
return instance;
}
public Process exec( String[] cmdarray ) throws IOException {
if( hasSpawner )
return new Spawner( cmdarray );
return runtime.exec( cmdarray );
}
public Process exec(String cmd) throws IOException {
if (hasSpawner)
return new Spawner(cmd);
return runtime.exec(cmd);
}
public Process exec( String[] cmdarray, String[] envp ) throws IOException {
if( hasSpawner )
return new Spawner( cmdarray, envp );
return runtime.exec( cmdarray, envp );
}
public Process exec(String[] cmdarray) throws IOException {
if (hasSpawner)
return new Spawner(cmdarray);
return runtime.exec(cmdarray);
}
public Process exec( String cmd, String[] envp ) throws IOException {
if( hasSpawner )
return new Spawner( cmd, envp );
return runtime.exec( cmd, envp );
}
public Process exec(String[] cmdarray, String[] envp) throws IOException {
if (hasSpawner)
return new Spawner(cmdarray, envp);
return runtime.exec(cmdarray, envp);
}
public Process exec( String cmd, String[] envp, File dir ) throws IOException {
if( hasSpawner )
return new Spawner( cmd, envp, dir );
return runtime.exec( cmd, envp, dir );
}
public Process exec(String cmd, String[] envp) throws IOException {
if (hasSpawner)
return new Spawner(cmd, envp);
return runtime.exec(cmd, envp);
}
public Process exec( String cmdarray[], String[] envp, File dir )
throws IOException
{
if( hasSpawner )
return new Spawner( cmdarray, envp, dir );
return runtime.exec( cmdarray, envp, dir );
}
public Process exec(String cmd, String[] envp, File dir)
throws IOException {
if (hasSpawner)
return new Spawner(cmd, envp, dir);
return runtime.exec(cmd, envp, dir);
}
public Process exec(String cmdarray[], String[] envp, File dir)
throws IOException {
if (hasSpawner)
return new Spawner(cmdarray, envp, dir);
return runtime.exec(cmdarray, envp, dir);
}
}