public void postArtifact(final Artifact artifact, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
        final Client client = getClient(user, password);
        final WebResource resource = client.resource(serverURL).path(RequestUtils.artifactResourcePath());
        final ClientResponse response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class, artifact);

        client.destroy();
        if(ClientResponse.Status.CREATED.getStatusCode() != response.getStatus()){
            final String message = "Failed to POST artifact";
            if(LOG.isErrorEnabled()) {
                LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus()));
            }
            throw new GrapesCommunicationException(message, response.getStatus());
        }
    }
public void postArtifact ( final Artifact artifact , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . artifactResourcePath ( ) ) ; final ClientResponse response = resource . type ( MediaType . APPLICATION_JSON ) . post ( ClientResponse . class , artifact ) ; client . destroy ( ) ; if ( ClientResponse . Status . CREATED . getStatusCode ( ) != response . getStatus ( ) ) { final String message = "Failed to POST artifact" ; if ( LOG . isErrorEnabled ( ) ) { LOG . error ( String . format ( HTTP_STATUS_TEMPLATE_MSG , message , response . getStatus ( ) ) ) ; } throw new GrapesCommunicationException ( message , response . getStatus ( ) ) ; } }
Post an artifact to the Grapes server

@param artifact The artifact to post
@param user The user posting the information
@param password The user password
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException