Community articleextractFile method
Added by IBM contributorIBM on May 2, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This method will extract an enclosure contained in a node and save it to a file on the local computer. Note that this method does not remove the enclosure from the form.


   public void extractFile(
      String theFile
  ) throws UWIException;


Table 1. Method parameters
theFileStringThe path showing where to store the file on the local drive. Any existing file will be overwritten.


Nothing if call is successful or throws a generic exception (UWIException) if an error occurs.


In the following example, dereferenceEx is used to locate a specific data item node. extractFile is then used to write the image data to the local drive.
   private static void exportImage(FormNodeP theForm) throws Exception
   FormNodeP tempNode;
      if ((tempNode = theForm.dereferenceEx(null, "PAGE1.LOGODATA", 0, 
         FormNodeP.UFL_ITEM_REFERENCE, null)) == null)
         throw new UWIException("Could not find LOGODATA node.");

Parent topic:
FormNodeP class