eclipse-edc / Technology-Azure

Apache License 2.0
2 stars 9 forks source link

fix: Logic for naming objects at destination #171

Closed zub4t closed 7 months ago

zub4t commented 8 months ago

What this PR changes/adds

This PR modifies the logic to decide what will be the name of the file/s to be saved on sink side. Now the sink side decides the name of the file/s based on the number of existing parts in a transfer and does not rely anymore in blobPrefix/blobName property.

Why it does that

The logic was modified since the sink does not know how many files will be transferred in a flow request. And when multiple files was transferred using the property blobName in the flow request it does override on sink side. But not anymore.

Linked Issue(s)

Closes #169

zub4t commented 7 months ago

please add a test that demonstrates the changes you provided

Done 😊

zub4t commented 7 months ago

my proposal was to have an "injectable" component, so that DestinationBlobName should be not static, have folderName and blobName as fields and the getDestinationBlobName should take only the partName and the partsSize. It would be instantiated in the data sink factory and passed to the data sink.

This way you could move the tests about the way the blob name is build to that class, and in the data sink test just instantiate it as a mock and verify the collaboration

I did my best to do what you proposed 😊

github-actions[bot] commented 7 months ago

This pull request is stale because it has been open for 7 days with no activity.