Skip to content

Improve String Handling for Empty and Whitespace Parameters in Key and Bucket Methods#409

Merged
joneubank merged 2 commits into
developfrom
fix/handle-blank-string-parameters
Jun 12, 2024
Merged

Improve String Handling for Empty and Whitespace Parameters in Key and Bucket Methods#409
joneubank merged 2 commits into
developfrom
fix/handle-blank-string-parameters

Conversation

@Azher2Ali
Copy link
Copy Markdown
Contributor

All three code changes introduced the use of the isBlank() method to handle empty strings in different contexts:

getKey and getMetaKey methods: These methods now check if the dir variable is empty. If it is empty, they return only the objectId. Otherwise, they maintain the original behavior of concatenating the directory path and object identifier. This provides more flexibility in handling scenarios where the data might not have a specific directory structure.

getObjectMetaKey method: Similar to the previous change, this method now checks if the dataDir parameter is empty. If it's empty, it creates a key using only the objectId with the ".meta" extension. This allows the method to function even when no directory path is provided.

readBucket method: This method now checks if the prefix parameter is empty. If it's empty, it retrieves all objects from the specified S3 bucket. Otherwise, it continues to filter objects based on the provided prefix. This change offers more control over how you list S3 objects, allowing you to retrieve all objects within a bucket if needed.

In summary, these changes enhance the code's ability to handle empty strings, making it more adaptable to various situations where directory paths or prefixes might be absent.

@Azher2Ali Azher2Ali requested a review from joneubank June 12, 2024 11:34
@Azher2Ali Azher2Ali changed the title Fix/handle blank string parameters Improve String Handling for Empty and Whitespace Parameters in Key and Bucket Methods Jun 12, 2024
@joneubank joneubank merged commit 13a8534 into develop Jun 12, 2024
@joneubank joneubank deleted the fix/handle-blank-string-parameters branch June 12, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants