I am in the process of determining how we can remove old versions of
artifacts.  I am using java with jersey.

I am able to retrieve a list of versions for an artifact, however, when I
try to delete a version, I get the following error message:

Exception in thread "main"
com.sun.jersey.api.client.UniformInterfaceException: DELETE
http://oesachchive2:8081/artifactory/api/search/artifact?name=http://oesachchive2:8081/artifactory/api/storage/libs-snapshot-local/scv/cais/fms/fmsCommon/1.0.3.28/fmsCommon.jar&repos=libs-snapshot-local
returned a response status of 405 Method Not Allowed
        at 
com.sun.jersey.api.client.WebResource.voidHandle(WebResource.java:707)
        at com.sun.jersey.api.client.WebResource.access$400(WebResource.java:74)
        at
com.sun.jersey.api.client.WebResource$Builder.delete(WebResource.java:579)
        at
scv.oes.rest.artifactory.client.ArtifactoryTestClient.run(ArtifactoryTestClient.java:66)
        at
scv.oes.rest.artifactory.client.ArtifactoryTestClient.main(ArtifactoryTestClient.java:34)

I am just doing a POC now, so am hard coding the artifact I wish to delete. 
Here is the line of code that throws the error:

service.path("api").path("search").path("artifact").queryParam("name",
deleteArtifactName).queryParam("repos",
"libs-snapshot-local").header("Authorization", getAuthorization()).delete();


Service is a WebResource.  
getAuthorization() returns a base 64 encoded byte[] of the admin user and
password.

I came across a couple posts where it was mentioned that we needed to set
http headers authorization.  I have not been able to get this to work.

Thanks for any help








--
View this message in context: 
http://forums.jfrog.org/Rest-API-returned-a-response-status-of-405-Method-Not-Allowed-tp7579932.html
Sent from the Artifactory - Users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Artifactory-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/artifactory-users

Reply via email to