Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Can I move files to another branch using CSSDK?
System
TA 6.1 Win 2K
Is it possible to move/copy a file from one branch to another branch using the CSSDK APIs?
It seems that CSFile.copy() method accepts only CSAreaRelativePath as a parameter.
Is there any workaround/ other APIs?
TIA
Find more posts tagged with
Comments
Migrateduser
You can't move, but you can copy:
use CSWorkarea.update(CSAreaRelativePath[] filePaths, CSArea sourceArea, int overwriteFlag)
- Navneet
Migrateduser
Thanks Navneet.
It solved the problem.
mk2004
can you please elaborate on this? thx
Migrateduser
I was looking for a way to move files from one branch to another using the CSSDAK APIs.
With the above mentioned API I was able to copy the file.
Then if the copy was successful I deleted the file from the source programatically.
HTH
PaulW
Am I correct in saying that the workarea.update() method can only copy files to the same relative area in the target branch? If this is true, I have been having the issue where I am trying to copy a file form the root of a source branch, to a subfolder of the root of the target branch, where the target branch already contains a file with the same name in the root.
So does the following and you wish to copy to a different relative area on a different branch, would I be required to:
1. create a copy of source file on source branch.
2. copy source copy across branch
3. move to correct relative location
4. rename file to original filename
Or is their a simpler way of doing this?
Adam Stoller
You could create a copy in the source branch with the correct name in the correct location for the new branch, and then 'update' it to the target branch (which will use the name and location from the source branch) - and then, presumably, delete the copy from the source branch.
I'm not sure about CSSDK functions - but the other possibility is to just copy it from the source branch into the correct location of the target branch (not an update, but a copy) - though in either case you may want to verify whether EA's are preserved if that matters for you.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
PaulW
thanks for the thoughts mate. I guess I need to assume the target folder on the source branch could contain a file with the same name, in which case I will have to rename the file to something like "sourcefile.iwtemp". then rename at target. I cannot do a straight copy, because it doesn't preserve EA's.
Do you But after thinking about it, I changed my solution to use CSSimpleFile.getExtendedAttributes, copy the file, and then call CSSimpleFile.setExtendedAttributes. this made it alot simpler, and I could remove lots of code to handle the combination of possibilities that i was catering for.