JCRUtil.copy vs Workspace.copy - which one to use and when | Community
Skip to main content
Level 2
May 16, 2017
Solved

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

  • May 16, 2017
  • 1 reply
  • 1069 views

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.
Best answer by MC_Stuff

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

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,