@@ -146,7 +146,8 @@ protected void doImport() throws IOException, MojoFailureException,Exception {
146146
147147 logger .info ("\n \n =============Importing App================\n \n " );
148148 state = State .IMPORTING ;
149- bundleRevision = RestUtil .uploadBundle (super .getProfile (), super .getApplicationBundlePath ());
149+ RestUtil restUtil = new RestUtil (super .getProfile ());
150+ bundleRevision = restUtil .uploadBundle (super .getProfile (), super .getApplicationBundlePath ());
150151
151152
152153 } catch (IOException e ) {
@@ -165,7 +166,8 @@ protected void doUpdate(String revision) throws IOException, MojoFailureExceptio
165166
166167 logger .info ("\n \n =============Updating App================\n \n " );
167168 state = State .IMPORTING ;
168- bundleRevision = RestUtil .updateBundle (super .getProfile (), super .getApplicationBundlePath (),revision );
169+ RestUtil restUtil = new RestUtil (super .getProfile ());
170+ bundleRevision = restUtil .updateBundle (super .getProfile (), super .getApplicationBundlePath (),revision );
169171
170172 } catch (IOException e ) {
171173 throw e ;
@@ -185,7 +187,8 @@ public void doDeactivae() throws IOException, MojoFailureException,Exception {
185187 try {
186188 logger .info ("\n \n =============Deactivating App================\n \n " );
187189 state = State .DEACTIVATING ;
188- RestUtil .deactivateBundle (super .getProfile ());
190+ RestUtil restUtil = new RestUtil (super .getProfile ());
191+ restUtil .deactivateBundle (super .getProfile ());
189192 }
190193 catch (IOException e ) {
191194 throw e ;
@@ -204,7 +207,8 @@ public void doRefreshBundle() throws IOException, MojoFailureException{
204207 try {
205208 logger .info ("\n \n =============Refresh Bundle================\n \n " );
206209 state = State .ACTIVATING ;
207- RestUtil .refreshBundle (super .getProfile (), this .bundleRevision );
210+ RestUtil restUtil = new RestUtil (super .getProfile ());
211+ restUtil .refreshBundle (super .getProfile (), this .bundleRevision );
208212 } catch (IOException e ) {
209213 throw e ;
210214 } catch (RuntimeException e ) {
@@ -222,7 +226,8 @@ public void doActivateBundle() throws IOException, MojoFailureException, Interr
222226 try {
223227 logger .info ("\n \n =============Activating Bundle================\n \n " );
224228 state = State .ACTIVATING ;
225- String revision = RestUtil .activateBundleRevision (super .getProfile (), this .bundleRevision );
229+ RestUtil restUtil = new RestUtil (super .getProfile ());
230+ String revision = restUtil .activateBundleRevision (super .getProfile (), this .bundleRevision );
226231
227232 // if user passed -Dapigee.options=async, no need for polling, exit early
228233 if (Options .async ) {
@@ -232,7 +237,7 @@ public void doActivateBundle() throws IOException, MojoFailureException, Interr
232237 boolean deployed = false ;
233238 //Loop to check the deployment status
234239 for (; !deployed ; ) {
235- deployed = RestUtil .getDeploymentStateForRevision (super .getProfile (), revision );
240+ deployed = restUtil .getDeploymentStateForRevision (super .getProfile (), revision );
236241 Thread .sleep (5 *1000 );
237242 }
238243 } catch (IOException e ) {
@@ -249,14 +254,15 @@ public void doActivateBundle() throws IOException, MojoFailureException, Interr
249254
250255 public void doDelete () throws IOException , MojoFailureException ,Exception {
251256 try {
252- String status = RestUtil .deactivateBundle (this .getProfile ());
257+ RestUtil restUtil = new RestUtil (this .getProfile ());
258+ String status = restUtil .deactivateBundle (this .getProfile ());
253259 if (status == null ) {
254260 logger .info ("No bundle to delete" );
255261 return ;
256262 }
257263 logger .info ("\n \n =============Deleting bundle================\n \n " );
258264 state = State .DELETING ;
259- RestUtil .deleteBundle (this .getProfile ());
265+ restUtil .deleteBundle (this .getProfile ());
260266 } catch (IOException e ) {
261267 throw e ;
262268 } catch (RuntimeException e ) {
0 commit comments