on 11-17-2009 1:12 PM
Hello,
How can I copy files in KM without overwrite the content?
I think the copy() method of IResource, overwrite content...
i.e.:
There is a source folder with FileA & FileB.
The destination folder has FileA.
I need to copy just FileB, no overwrite FileA.
It's possible? This is an example, in my case I will copy hyndreds of files and I need this validation.
Thanks!!!
Hi,
you can use this code:
IResourceList resList = folder.getChildren();
RID fileRid = RID.getRID(kmFolder + "/" + element.getFilename());
IResource fileRes = factory.getResource(fileRid, context);
if (fileRes != null) {
if (!resList.containsResource(fileRes)) {
IResource newResource = folder.createResource(element.getFilename(), null, content);
}
}
instead of my createResource you can probably use the copy method.
Best regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.