PTP
Release 7.0

org.eclipse.ptp.etfw
Interface IBuildLaunchUtils


public interface IBuildLaunchUtils

Interface defining a collection of operations relevant to filesystem or remote/local sensitive operations for use in ETFw workflows

Since:
5.0

Method Summary
 String askToolPath(String archpath, String toolName)
          Given a tool's name, ask the user for the location of the tool
 String askToolPath(String archpath, String toolText, String toolMessage)
          Given a string as a starting point, this asks the user for the location of a tool's directory
 String checkToolEnvPath(String toolname)
          This locates the directory containing the given tool.
 String findToolBinPath(String toolfind, String suggPath, String toolName)
          Returns the directory containing the tool's executable file.
 String findToolBinPath(String toolfind, String suggPath, String queryText, String queryMessage)
          Returns the directory containing the tool's executable file.
 void getAllToolPaths(ExternalToolProcess[] tools, boolean force)
          Iterates through an array of tools, populating the preference store with their binary directory locations
 IFileStore getFile(String path)
          Convenience method to return the the given file as located by the IBuildLaunch object's file store
 String getToolPath(String toolID)
          Given a tool's ID, returns the path to that tool's bin directory if already known and stored locally, otherwise returns the empty string
 String getWorkingDirectory()
          Returns the working directory associated with this object's remote connection, if any.
 boolean isRemote()
          Returns true if this object is configured with a remote connection, false if it is using a local connection.
 boolean runTool(List<String> tool, Map<String,String> env, String directory)
          Launches a command on the local system.
 boolean runTool(List<String> tool, Map<String,String> env, String directory, String output)
           
 byte[] runToolGetOutput(List<String> tool, Map<String,String> env, String directory)
           
 byte[] runToolGetOutput(List<String> tool, Map<String,String> env, String directory, boolean showErr)
           
 void runVis(List<String> tool, Map<String,String> env, String directory)
          Attempt to launch a UI based application.
 void verifyRequestToolPath(ExternalToolProcess tool, boolean force)
          Associate the filesystem location of this tool's executable with its group
 

Method Detail

askToolPath

String askToolPath(String archpath,
                   String toolName)
Given a tool's name, ask the user for the location of the tool


askToolPath

String askToolPath(String archpath,
                   String toolText,
                   String toolMessage)
Given a string as a starting point, this asks the user for the location of a tool's directory


checkToolEnvPath

String checkToolEnvPath(String toolname)
This locates the directory containing the given tool.

Parameters:
The - name of the tool whose directory is being located
Returns:
The uri of the location of the tool's containing directory, or null if it is not found or if the architecture is windows

findToolBinPath

String findToolBinPath(String toolfind,
                       String suggPath,
                       String toolName)
Returns the directory containing the tool's executable file. Prompts the user for the location if it is not found. Returns the empty string if no selection is made

Parameters:
toolfind - The name of the executable being sought
suggPath - The suggested path upon which to focus the directory locator window
toolName - The name of the tool used when prompting the user for its location
selshell - The shell in which to launch the directory locator window
Returns:

findToolBinPath

String findToolBinPath(String toolfind,
                       String suggPath,
                       String queryText,
                       String queryMessage)
Returns the directory containing the tool's executable file. Prompts the user for the location if it is not found. Returns the empty string if no selection is made

Parameters:
toolfind - The name of the executable being sought
suggPath - The suggested path upon which to focus the directory locator window
queryText - The text asking the user to search for the binary
queryMessage - The text providing more detail on the search task
selshell - The shell in which to launch the directory locator window
Returns:

getAllToolPaths

void getAllToolPaths(ExternalToolProcess[] tools,
                     boolean force)
Iterates through an array of tools, populating the preference store with their binary directory locations

Parameters:
tools - The array of tools to be checked
force - If true existing values will be overridden.

getFile

IFileStore getFile(String path)
Convenience method to return the the given file as located by the IBuildLaunch object's file store

Parameters:
path -
Returns:

getToolPath

String getToolPath(String toolID)
Given a tool's ID, returns the path to that tool's bin directory if already known and stored locally, otherwise returns the empty string

Parameters:
toolID -
Returns:

getWorkingDirectory

String getWorkingDirectory()
Returns the working directory associated with this object's remote connection, if any.

Returns:

isRemote

boolean isRemote()
Returns true if this object is configured with a remote connection, false if it is using a local connection.

Since:
7.0

runTool

boolean runTool(List<String> tool,
                Map<String,String> env,
                String directory)
Launches a command on the local system.

Parameters:
tool - The command to be run
env - A list of environment variables to associate with the tool
directory - The directory where the tool is invoked

runTool

boolean runTool(List<String> tool,
                Map<String,String> env,
                String directory,
                String output)
Parameters:
tool - The command to be run
env - A list of environment variables to associate with the tool
directory - The directory where the tool is invoked
output - The path to the file where the output should be written
Returns:

runToolGetOutput

byte[] runToolGetOutput(List<String> tool,
                        Map<String,String> env,
                        String directory)
Parameters:
tool - The command to be run, including arguments
env - A list of environment variables to associate with the tool
directory - The directory where the tool is invoked
Returns:
byte array representing the output of the program executed

runToolGetOutput

byte[] runToolGetOutput(List<String> tool,
                        Map<String,String> env,
                        String directory,
                        boolean showErr)
Parameters:
showErr - set to true if the stderr from the program should be included in the output, otherwise false
Returns:
byte array representing the output of the program executed
Since:
7.0

runVis

void runVis(List<String> tool,
            Map<String,String> env,
            String directory)
Attempt to launch a UI based application.

Parameters:
tool - The command to be run, including arguments
env - A list of environment variables to associate with the tool
directory - The directory where the tool is invoked

verifyRequestToolPath

void verifyRequestToolPath(ExternalToolProcess tool,
                           boolean force)
Associate the filesystem location of this tool's executable with its group

Parameters:
tool - The object containing the tool to be located
force - if true proceed with the check and association even if there is already a path associated with the group

PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.