Retrieve partitions when metadata contains either full or file-only prefix - Update storage path logic
@@ -448,7 +448,17 @@ public class BusinessObjectDataDdlPartitionsHelper
{
// Retrieve storage file paths registered with this business object data in the specified storage.
storageFilePaths = storageUnitIdToStorageFilePathsMap.containsKey(storageUnitAvailabilityDto.getStorageUnitId()) ?
- storageUnitIdToStorageFilePathsMap.get(storageUnitAvailabilityDto.getStorageUnitId()) : new ArrayList<>();
+ new ArrayList<>(storageUnitIdToStorageFilePathsMap.get(storageUnitAvailabilityDto.getStorageUnitId())) : new ArrayList<>();
+
+ // If storage directory path is specified, prepend it to storage file paths, if not already there.
+ if (StringUtils.isNotBlank(storageUnitAvailabilityDto.getStorageUnitDirectoryPath()))
+ {
+ // Since storage unit directory path represents a directory, we add a trailing '/' character to it, unless it is already present.
+ String storageUnitDirectoryPath = StringUtils.appendIfMissing(storageUnitAvailabilityDto.getStorageUnitDirectoryPath(), "/");
+
+ // Prepend storage unit directory path to storage file paths, if not already there.
+ storageFilePaths.forEach(storageFilePath -> StringUtils.prependIfMissing(storageFilePath, storageUnitDirectoryPath));
+ }
// Validate storage file paths registered with this business object data in the specified storage.
// The validation check below is required even if we have no storage files registered.
