Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
    import edu.mit.libraries.facade.app.DSpaceSIP;

    // Create SIP; validate = false, ZIP compression = BEST_SPEED
    DSpaceSIP sip = new DSpaceSIP(false, Deflater.BEST_SPEED);
     
    // Optional: Set the METS OBJID
    sip.setOBJID(myObjID);

    // Optional: Set the METS creator
    sip.addAgent("CREATOR", "ORGANIZATION", "MyUniversity Libraries");
     
    // add content objects - last arg is "is Primary Bitstream"
    sip.addBitstream(new File("thesis102.pdf"), "content/thesis.pdf", "ORIGINAL", true);
    sip.addBitstream(new File("thesis102.doc"), "content/thesis.doc", "ORIGINAL", false);
     
    // add the descriptive metadata as JDOM Element; the package also
    // accepts a String of serialized XML or a file of any format.
    Element modsElt = myMakeMetadata();
    sip.addDescriptiveMD("MODS", modsElt);
     
    // Write SIP to a file
    File outfile = File.createTempFile(myObjID,".zip", targetDir);
    sip.write(outfile);

...

Downloading and Running DSpaceSIP

  • Wiki Markup
    Note this class and its dependencies have been defined in a modules in the DSpace SVN repository located here \[-\-[Mark Diggory|http://scm.dspace.org/svn/repo/modules/dspace-sip]\] 16:40, 5 June 2009 (EDT)
  • Download here .... Link for file maintenance: !DSpaceSIP.java!  

To use this class in your application, you will also need the following
Java libraries on your classpath:

...