'How to get a list of all packages in a repository with specified package tyep(like npm, maven...) in Jfrog Artifactory using its API?
I'm working on a project, used to collect package information from Jfrog Artifactory repositories. Now I wonder how to get a list of packages in a specified repo using jfrog rest api?
Note: I tried to use AQL, for example, item.find{...}, but it general return all related artifacts (not only package information).
Solution 1:[1]
You can use the GraphQL API for querying package information.
curl -H "Authorization: Bearer <access-token>" \
-XPOST https://<your-domain>/metadata/api/v1/query \
-d '{"query":"..." }'
See the documentation linked above for the syntax, available filters, and more.
Solution 2:[2]
If you want to get all repositories of a specific package type, for example, Docker, try this URL:
curl -u username:password -X GET "https://artifactory.es/artifactory/api/repositories?packageType=docker"
Solution 3:[3]
In Java, a method signature is part of the method declaration. It's the combination of the method name and the parameter list.
When we talk about the same method signature in the superClass and the subClass + a covariant return type , so we are talking about the Overriding .
(Same signature + Covariant return type) == Overriding
Solution 4:[4]
As I know, you can not change the return type if you make an inheritance relation and you use the same signature for a method that exists already in the parent class except if you want to change the return type for a type that is an instance of the original type, otherwise which will cause a syntax error, so you need to change the method signature in the subclass or override it. Suppose that will be applicable, so a subclass will have two methods with the same signature one that is inherited and the other you explicitly write, so when you invoke it, the JVM will not know which one to invoke, so that is not applicable. Be careful to override a method it should be an instance method and the same signature and the same return type or an instance of the original type and the same access modifier or stronger, otherwise, it will cause a syntax error.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | yinon |
| Solution 2 | Adrian Mole |
| Solution 3 | |
| Solution 4 |
