Code example for HttpPut

Methods: setEntity

0
            final FileBody fileBody = new FileBody( file );
 
            final MultipartEntity entity = new MultipartEntity();
            entity.addPart( file.getName(), fileBody );
             
            final HttpPut httpPut = new HttpPut();
            httpPut.setEntity( entity );
             
            Object response = httpJSONAPI( httpPut, getUpdateURI( appName ) );
             
            if( response instanceof JSONObject )
            { 
                JSONObject json = (JSONObject)response;
                 
                if( isSuccess( json ))
                { 
                    System.out.println( "updateApplication: success." ); //$NON-NLS-1$
                } 
                else 
                { 
                    return "updateApplication: error " + getUpdateURI(appName); //$NON-NLS-1$