You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by "Johnson, Russell D (PNNL)" <rd...@pnl.gov> on 2001/07/17 00:17:38 UTC

Slide API - saving a node to disk.

Hi!

I'm trying to figure out how you can use Slide's Java API to save an actual
file/object/stream, etc. to disk space instead of just in memory.

I haven't been able to discover the appropriate methodology for this yet.

Forgive me if this type of question is supposed to go to the user list.

I'm new to slide and these discussion threads.

Any help is appreciated.

As a simple method, I've gotten this far:

   void save_node( NamespaceAccessToken token,
                   Structure structure,
                   SlideToken slideToken,
                   String path,
                   String filename )
      {
      Content content = token.getContentHelper();

      String pathfilename = path;

      if ( filename != "" )
         {
         pathfilename = path + "/" + filename;
         }

      try
         {
         content.retrieve( slideToken, pathfilename );

         File thefile = new File( "C://Some//Path//Filename.txt" );

         FileInputStream pfn = new FileInputStream( thefile );

         ObjectInputStream opfn = new ObjectInputStream( pfn );

         NodeRevisionDescriptor revisionDescriptor = new
NodeRevisionDescriptor(0);

         NodeRevisionContent    revisionContent    = new NodeRevisionContent();

         revisionContent.setContent( opfn );



         ?????  Where do you go from here?   ?????



         }
      catch ( Exception e )
         {
         }
      }

Thanks.

--------------------------------------------------------------------------------

              RUSSELL DEAN JOHNSON             Space Pirate Ryoko's Starship
                 (DarkAcroyear)                       And Pet Cabbit
                                                 _______     _     _______
                 * Scientist *                 /____ \\\\\ / o \ ///// ____\
     Pacific Northwest National Laboratory           \_\\\| ^+^ |///_/
                                                        // \ U / \\
              * Adjunct Faculty *                    _____/ | | \_____
    Washington State University - Tri-Cities        m------ m m ------m

--------------------------------------------------------------------------------