Skip to Content
0
Former Member
Apr 20, 2009 at 06:07 PM

Copy and rename a file to a new folder through UIcommands

26 Views

Hi Everybody,

how can i copy a file from one folder to another and changing the filename in target folder. Until now i can only copy the file but not change the displayname:

RID source = RID.getRID( "/folderA/fileA.doc" );
ICopyParameter param = new CopyParameter(true);
resource = ResourceFactory.getInstance().getResource( RID.getRID( source ), rContext); 
resource.copy(RID.getRID("/folderB/fileB.doc"), param);	

After the action the path of the copied file is " /folder/fileB.doc" but the displayname in KM was "fileA.doc". I don't understand...

During the debugging the parameter source gives me the follwing value:

Detail formatter error: Syntax error on token "/", ";" expected

But the file was still copied.Could this be the mistake? I am working on EHP1 7.0.

regards,

Sid