Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_object_list callback prefix field should be Vec<String> #9

Closed
weekitmo opened this issue Jan 13, 2023 · 3 comments
Closed

get_object_list callback prefix field should be Vec<String> #9

weekitmo opened this issue Jan 13, 2023 · 3 comments

Comments

@weekitmo
Copy link

weekitmo commented Jan 13, 2023

this is the result when i use nodejs to test.
image
image

When using prefix and delimiter to query together, prefixes means the sub folder that contains prefix。in my case, i print &response.prefix() only the last one string.

reference:

https://help.aliyun.com/document_detail/84841.html#p-awp-qxy-gu1

@weekitmo
Copy link
Author

weekitmo commented Jan 13, 2023

    fn set_prefix(&mut self, prefix: &str) -> Result<(), Self::Error> {
        if self.prefix == ""  {
            self.prefix.push_str(&prefix.to_owned())
        } else {
            self.prefix.push_str(format!(",{}", &prefix.to_owned()).as_str());
        }
        
        Ok(())
    }

and use it

    let prefixes = response.prefix();
    let vec_prefixes: Vec<&str> = prefixes.split(",").collect();
    for pre in vec_prefixes {
        // TODO
    }

This is my adjustment. Maybe you have your own ideas

@tu6ge
Copy link
Owner

tu6ge commented Jan 13, 2023

I look at aliyun docs, and find CommonPrefixes and Prefix is two different field of response.

so, ObjectList should add a new filed. used by save CommonPrefixes info

@weekitmo
Copy link
Author

pretty good

@tu6ge tu6ge closed this as completed in c3e54c1 Jan 15, 2023
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 a pull request may close this issue.

2 participants