Search code examples
javacoldfusionjarcoldfusion-9google-voice

Using Coldfusion to Programmatically Access the Google Voice Java API


Can anyone tell me how to use Coldfusion to access and interact with the Google Voice Java API?

  1. Specifically how would I access API jar files?

  2. How would I programtically access these files/classes via Coldfusion's Java capabilities? For example within a CFC what java classes/functions would I need to call?

  3. Even more basic, in which coldfusion folder would the Java API jar need to be installed?

Stackoverflow member @GuidDoody mentioned he was able to successfully use the Java API with Coldfusion here: CFHTTP Content-Length Header for post to Google Voice "API" . However, no details were given as to how!

Alternatively, am I better off just using CFHTTP to "hack" a log-in and data capture sequence programamtically?

Here is are the resources I've searched so far. But I need help on doing steps 1 - 3 above :

  1. Google Voice Java API How to: http://code.google.com/p/google-voice-java/wiki/GettingStarted

  2. Java API string value pairs: http://www.google.com/support/forum/p/voice/thread?tid=7d165bcdbdba6464&hl=en

  3. @GuidDoody's use of CFHTTP: CFHTTP Content-Length Header for post to Google Voice "API"

Thanks

Jason


Solution

  • I think Mark Mandel's JavaLoader is what you are looking for: http://javaloader.riaforge.org/

    Here's an example of how I used it to use the Evernote API jar files:

    //first create an array of locations to your jar files
    jarArray = ["#libDirectory#/CFEvernote.jar","#libDirectory#/evernote-api-1.18.jar","#libDirectory#/libthrift.jar"];
    
    //then create an instance of the classloader and pass it your jar array
    classLoader = createObject("component", "JavaLoader").init(jarArray );
    
    //then use the classloader.create method to create a new java object
    note = classLoader.create("com.evernote.edam.type.Note").init();