com.autodesk.workflows
Class Autodesk

java.lang.Object
  extended by com.autodesk.workflows.Autodesk

public class Autodesk
extends java.lang.Object


Method Summary
static Response DoTranslation(java.lang.String inputFile, java.lang.String outputFile, java.lang.String inputType, java.lang.String outputType, java.lang.String[] extraArgs)
          Do a translation using the GreenBox DoTranslation command.
static Response exec(java.lang.String[] command, java.lang.String[] envp)
          Run an external command.
static java.lang.String getFileType(java.lang.String file, byte[] buf)
          Given a file this method determines the type of the file.
static java.lang.String[] getSuffixes(java.lang.String fileType, boolean inputSuffixes)
          Determine the suffixes that are permitted for a particular file type.
static java.lang.String[] getTranslationInputs()
          Determine the file types that are supported for input.
static java.lang.String[] getTranslationOutputs()
          Determine the file types that are supported for output.
static Response maya(java.lang.String melScript)
          Run Maya in batch mode.
static Response maya(java.lang.String melScript, java.lang.String version)
          Run Maya in batch mode.
static boolean runWorkflow(java.io.File file)
          Run the named workflow.
static Response tessellate(java.lang.String inputFile, java.lang.String outputFile)
          Do a tessellation.
static Response tessellate(java.lang.String inputFile, java.lang.String outputFile, java.lang.String settingsFile)
          Do a tessellation.
static Response translate(java.lang.String inputFile, java.lang.String outputFile)
          Do a translation.
static Response translate(java.lang.String inputFile, java.lang.String outputFile, java.lang.String inputType, java.lang.String outputType)
          Do a translation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

DoTranslation

public static Response DoTranslation(java.lang.String inputFile,
                                     java.lang.String outputFile,
                                     java.lang.String inputType,
                                     java.lang.String outputType,
                                     java.lang.String[] extraArgs)
Do a translation using the GreenBox DoTranslation command. This always does synchronous translations so translations may take a while if there are any other translations pending.

Parameters:
inputFile - the name of the file to translate.
outputFile - the name of the file to produce.
inputType - the file type of the input file.
outputType - the file type being requested for the output file.
extraArgs - an array of arguments to pass to Aruba.
Returns:
a Response object containing status information from the translation.

exec

public static Response exec(java.lang.String[] command,
                            java.lang.String[] envp)
Run an external command.

Parameters:
command - an array with the first element being the command to run and the remaining elements the arguments to the command.
envp - an array of name=value strings defining the runtime environment.
Returns:
a Response object containing status information from the process.

translate

public static Response translate(java.lang.String inputFile,
                                 java.lang.String outputFile,
                                 java.lang.String inputType,
                                 java.lang.String outputType)
Do a translation. This version of the translation method allows the caller to override the default translation behaviour which uses the file suffix to determine file types. With this method the types of the input and output file types can be specified.

Parameters:
inputFile - the name of the file to translate.
outputFile - the name of the file to produce.
inputType - the type of the input file.
outputType - the type of the output file.
Returns:
a Response object containing the status information from the translation process. null is returned if the translator cannot be found.

translate

public static Response translate(java.lang.String inputFile,
                                 java.lang.String outputFile)
Do a translation. This uses the Autodesk translation technology to do a translation. The types of the files will be given by their suffixes.

Parameters:
inputFile - the name of the file to translate.
outputFile - the name of the file to produce.
Returns:
a Response object containing the status information from the translation process.

tessellate

public static Response tessellate(java.lang.String inputFile,
                                  java.lang.String outputFile)
Do a tessellation. This method is obsolete as it uses a fixed set of tessellation settings.


tessellate

public static Response tessellate(java.lang.String inputFile,
                                  java.lang.String outputFile,
                                  java.lang.String settingsFile)
Do a tessellation.

Parameters:
inputFile - the input file to tessellate.
outputFile - the file to send the tessellation to.
settingsFile - the file containing the tessellation settings.
Returns:
a Response object containing the status information from the tessellation process.

maya

public static Response maya(java.lang.String melScript,
                            java.lang.String version)
Run Maya in batch mode.

Parameters:
melScript - the name (including path) of a MEL script to run.
version - the version of Maya to run. This may be null in which case the newest version of Maya is used.
Returns:
a Response object containing the status information from the running of Maya. Will be null if Maya could not be found (either of the given version, or any if no version is specified).

maya

public static Response maya(java.lang.String melScript)
Run Maya in batch mode. Similar to the two argument version but does not care which version of Maya is used (just the most recent).


getTranslationInputs

public static java.lang.String[] getTranslationInputs()
Determine the file types that are supported for input.

Returns:
a String array. Each call returns a new array.

getTranslationOutputs

public static java.lang.String[] getTranslationOutputs()
Determine the file types that are supported for output.

Returns:
a String array. Each call returns a new array.

getSuffixes

public static java.lang.String[] getSuffixes(java.lang.String fileType,
                                             boolean inputSuffixes)
Determine the suffixes that are permitted for a particular file type. It's possible to get the suffixes used for input or output. The difference is that input suffixes will usually be several and are used to check if a suffix is of a particular type. Output suffixes are used when creating a file of a particular type and therefore require a specific suffix.

Parameters:
fileType - a file type as returned from either getTranslationInputs() or getTranslationOutputs()
inputSuffixes - if true then input suffixes are return, otherwise output suffixes are returned. .
See Also:
getTranslationInputs(), getTranslationOutputs()

getFileType

public static java.lang.String getFileType(java.lang.String file,
                                           byte[] buf)
Given a file this method determines the type of the file. This uses the server's descriptions so can only determine the file type of files that the server knows how to translate.

Parameters:
file - the fully qualified name of a file.
buf - some bytes from the head of the given file.
Returns:
the type of the file. These are the same types that would be returned by getTranslationInputs() or getTranslationOutputs().
See Also:
getTranslationInputs(), getTranslationOutputs()

runWorkflow

public static boolean runWorkflow(java.io.File file)
Run the named workflow. The workflow must have been submitted for the server to run it. All exceptions thrown by the workflow are caught and not rethrown.

Parameters:
file - a File object referencing the workflow to run. This may not be null.
Returns:
true is returned if the workflow ran without throwing any exceptions.