Skip to Content
Former Member
Apr 02, 2013 at 07:47 PM

Help copying file in KM from one directory to another


I am trying to copy a file from one directory to another in KM using the copy method and I am getting a name already exists exception

Here is the code:

RID sourceRep= RID.getRID("/DirectoryA/test.pdf");

RID destRep= RID.getRID("/DirectoryA/DirectoryB");

IResource resSource = ResourceFactory.getInstance().getResource(sourceRep, ctxt);

IResource resDest = ResourceFactory.getInstance().getResource(destRep, ctxt);

resSource.copy(resDest.getRID() ,null);

Is the resDest.getRID() supposed to be the destination folder of the file? If so then I do not understand why I am getting the name already exists exception since there is nothing in the new folder.

Any help would be greatly appreciated.