artifactory-client-java icon indicating copy to clipboard operation
artifactory-client-java copied to clipboard

Getting child nodes by using repo path

Open vsnmpkr opened this issue 12 years ago • 5 comments

Hey baruch, I need a small info. If I have a repo path, can you please tell me how do we get children of that respective repo path, I can see we get from Folder interface. If I have an Artifactory instance how do I get a Folder instance with the help of Artifactory instance and a repopath, please help I am stuck in the middle.

vsnmpkr avatar Jun 12 '13 13:06 vsnmpkr

@vsnmpkr tell me if that's what you are looking for?

Folder folder = artifactory.repository("repo1-cache").folder("junit").info();
        folder.getChildren();

Generally, you can find good usage examples in the tests. This one is from ItemTests.

jbaruch avatar Jun 12 '13 13:06 jbaruch

Hey Thanks,

I have tested, I got an item instance for folder.getChildren(), but I could not see any of the "Item" fields set except name and uri, all are null :(.

I want the repopaths of all the children and their sub children to get their metdata

vsnmpkr avatar Jun 12 '13 13:06 vsnmpkr

That looks like a bug. You should get a List of Items, which include repo and path fields. I'll look into it, thanks for pointing it out.

jbaruch avatar Jun 12 '13 14:06 jbaruch

Forgot to mention, I got list of items only, as the repopath contains only one child, I retrieved the first child (Item) and printed the fields of that Item. While I print those I found the above mentioned issue (null fields)

Thanks for your quick response.

vsnmpkr avatar Jun 12 '13 14:06 vsnmpkr