Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

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

Avatar

Level 2

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)

1 Accepted Solution

Avatar

Correct answer by
Level 9

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,

View solution in original post

1 Reply

Avatar

Correct answer by
Level 9

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,