boolean hasLock = IntegrationProjectLock.acquireWithin(5, TimeUnit.SECONDS);
if (hasLock) {
try {
EntityType sourceType = sourceFolder.getItemType();
FolderStructureDuplicator duplicator = new FolderStructureDuplicator(project, sourceType);
duplicator.duplicateTo(destinationTypes);
int newFolders = duplicator.getNumberOfNewFolders();
duplicator.save(persistor);
return newFolders;
} finally {
IntegrationProjectLock.release();