Skip to main content
Level 2
May 16, 2017 9:30 PM UTC
Solved

JCRUtil.copy vs Workspace.copy - which one to use and when

We are copying entire directory from one folder to other folder - we've two API's to do it. We can do it at workspace or using JCRUtil. Which one should we use and what are the use cases for each?

We do see this error sometimes when we do workspace.copy()  - unresolved conflicts (and fail during commit)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
MC_Stuff
MC_StuffAccepted solution
Level 10
May 17, 2017 6:55 AM UTC

Hi Chetan,

  • Functionality wise both are same & internal implementation have some changes. 
  • The main difference top of my head is  Workspace save don;t need transient storage and saves automatically. Where as JCRUtil need explicit session save. 
  • Any issue with copying will throw an exception. 
  • For your use case workspace copy looks good to me.

Thanks,

1 reply

MC_Stuff
MC_StuffAccepted solution
Level 10
May 17, 2017 6:55 AM UTC

Hi Chetan,

  • Functionality wise both are same & internal implementation have some changes. 
  • The main difference top of my head is  Workspace save don;t need transient storage and saves automatically. Where as JCRUtil need explicit session save. 
  • Any issue with copying will throw an exception. 
  • For your use case workspace copy looks good to me.

Thanks,

Translate