class UploadDownloadHelper {

    public void validateAndTrimBusinessObjectDataStorageFileKey(BusinessObjectDataStorageFileKey businessObjectDataStorageFileKey)
    {
        Assert.notNull(businessObjectDataStorageFileKey, "A business object data storage file key must be specified.");
        businessObjectDataStorageFileKey
            .setNamespace(alternateKeyHelper.validateStringParameter("namespace", businessObjectDataStorageFileKey.getNamespace()));
        businessObjectDataStorageFileKey.setBusinessObjectDefinitionName(alternateKeyHelper
            .validateStringParameter("business object definition name", businessObjectDataStorageFileKey.getBusinessObjectDefinitionName()));
        businessObjectDataStorageFileKey.setBusinessObjectFormatUsage(alternateKeyHelper
            .validateStringParameter("business object format usage", businessObjectDataStorageFileKey.getBusinessObjectFormatUsage()));
        businessObjectDataStorageFileKey.setBusinessObjectFormatFileType(alternateKeyHelper
            .validateStringParameter("business object format file type", businessObjectDataStorageFileKey.getBusinessObjectFormatFileType()));

        Assert.notNull(businessObjectDataStorageFileKey.getBusinessObjectFormatVersion(), "A business object format version must be specified.");

        businessObjectDataStorageFileKey.setPartitionValue(alternateKeyHelper
            .validateStringParameter("partition value", businessObjectDataStorageFileKey.getPartitionValue()));

        List<String> subPartitionValues = Lists.newArrayList();
        if (CollectionUtils.isNotEmpty(businessObjectDataStorageFileKey.getSubPartitionValues()))
        {
            for (String subPartitionValue : businessObjectDataStorageFileKey.getSubPartitionValues())
            {
                subPartitionValues.add(alternateKeyHelper.validateStringParameter("sub partition value", subPartitionValue));
            }
        }
        businessObjectDataStorageFileKey.setSubPartitionValues(subPartitionValues);

        Assert.notNull(businessObjectDataStorageFileKey.getBusinessObjectDataVersion(), "A business object data version must be specified.");

        businessObjectDataStorageFileKey.setStorageName(alternateKeyHelper
            .validateStringParameter("storage name", businessObjectDataStorageFileKey.getStorageName()));

        Assert.hasText(businessObjectDataStorageFileKey.getFilePath(), "A file path must be specified.");

        businessObjectDataStorageFileKey.setFilePath(businessObjectDataStorageFileKey.getFilePath().trim());
    }

}