Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

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,