Insert file into foldre

Options
pjmorce
edited June 17, 2010 in Documentum #1

Hello

I am starting developping with DFC.

I have developped a simple code which inserts a file into Documentum Content Server. The code is above:

public static IDfDocument store(IDfSession session, String sName, String title, String subject) throws Exception {
     IDfDocument document = null;
     if(session != null) {
          document = (IDfDocument) session.newObject("dm_document");
          document.setObjectName("This is the first a test (" + sName + ")");
          document.setTitle(title);
          document.setSubject(subject);
          document.setContentType("crtext");
          document.setFile(sName);
          document.save();
     }
     return document;
}

This method works fine, it inserts the given file into Content Server, more precisely on the "My Files" folder.

I would like to be able to insert the file into another folder (for exemple My Files/documents, supposing that this folder exists).

Is it possible? how can I do this?

Thanks

Regards

Comments

  • lastnitescurry
    edited June 17, 2010 #2
    Options

    see link method from IDfSysObject...

  • BartThierens
    edited June 17, 2010 #3
    Options

    As Brian said, use the link() method.

    ...document.link("/Temp/folder1/folder2");document.save();

    Make sure the provided folderpath refers to an existing folder, and make sure it starts with '/'.