class BusinessObjectDataStorageUnitServiceImpl implements BusinessObjectDataStorageUnitService {

    protected BusinessObjectDataStorageUnitCreateResponse createBusinessObjectDataStorageUnitCreateResponse(StorageUnitEntity storageUnitEntity)
    {
        // Get business object data key from the business object data entity.
        BusinessObjectDataKey businessObjectDataKey = businessObjectDataHelper.createBusinessObjectDataKeyFromEntity(storageUnitEntity.getBusinessObjectData());

        // Create a business object data storage unit create response.
        BusinessObjectDataStorageUnitCreateResponse response = new BusinessObjectDataStorageUnitCreateResponse();

        // Add business object data storage unit key.
        response.setBusinessObjectDataStorageUnitKey(
            storageUnitHelper.createBusinessObjectDataStorageUnitKey(businessObjectDataKey, storageUnitEntity.getStorage().getName()));

        // Add storage directory.
        if (storageUnitEntity.getDirectoryPath() != null)
        {
            response.setStorageDirectory(new StorageDirectory(storageUnitEntity.getDirectoryPath()));
        }

        // Add storage files.
        if (CollectionUtils.isNotEmpty(storageUnitEntity.getStorageFiles()))
        {
            response.setStorageFiles(storageFileHelper.createStorageFilesFromEntities(storageUnitEntity.getStorageFiles()));
        }

        // Return the response.
        return response;
    }

}