I tried to copy files/directory using cssdk. However files at target which are not in source got deleted .Is this transactional behavior expected? i worry not and there must be a way out.
command used:
dir.copy(csAreaRelativePath,true);
Copying a directory with overwrite doesn't seem like a smart thing to do, unless you're looking to end up with exactly what happened. It makes sense. What I would do is loop through the files in the source directory and copy them individually to the target path.
Well if we have a directory with multiple sub directories and then the files , we wont hard code to loop through the files. Rather just copy the directory.
I also tried looping and copying over with overwrite option set to false. It still deleted my existing files at target.
It's not that hard to write a recursive function to drill thorough subfolders looking for files. Open a support case - good luck. If you even mention CSSDK in a Support Case you will get the canned "We don't support custom code - but we'll gladly put you in touch with Professional Services". You have to clearly point out that you're questioning their API, not your customization.
I tried recursive(1 level),it still had issue.Will try debugging more. If i found a solution will post here..
Thanks for your support .
vishal11 wrote: I tried recursive(1 level),it still had issue.Will try debugging more. If i found a solution will post here.. Thanks for your support .
...it's not recursive if you're hardcoding the depth...