Greg
Greg

Reputation: 1367

How to check if an artifactory artifact exists?

I've got a path to the artifact but I do not want to download it, just check whether it exists. What would be the "cheapest/fastest" way to achieve it?

Upvotes: 4

Views: 8601

Answers (3)

szeitlin
szeitlin

Reputation: 3351

Adding an answer here in case other people are hunting for this like I was.

Buried in the docs, you can do a GET query to http://{your_artifactory_url}/api/storage/{path/to/file}. Make sure you allow redirects.

Note that this is different from the url you use to PUT files.

Upvotes: 4

yahavi
yahavi

Reputation: 6073

You can also use 'search' in JFrog CLI:

$ jfrog rt s libs-release-local/Bazinga --count
[Info] Searching artifacts...
[Info] Found 1 artifact.
1

$ jfrog rt s libs-release-local/Bazingaaaaa --count
[Info] Searching artifacts...
[Info] Found 0 artifacts.
0

Upvotes: 4

Greg
Greg

Reputation: 1367

I guess I know already...

I can use the HEAD-http method.

Upvotes: 5

Related Questions