Permalink
Browse files

Close client response / exception handling on UID nexus client

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>
  • Loading branch information...
1 parent a6e00bb commit 454c918f527cc210abec4e22271e2bde6e3ca5da @adreghiciu adreghiciu committed with cstamas Nov 15, 2012
@@ -44,7 +44,8 @@ public void lock( final String repository, final String path, final LockType loc
{
getNexusClient()
.serviceResource( uri )
- .get( ClientResponse.class );
+ .get( ClientResponse.class )
+ .close();
}
catch ( ClientHandlerException e )
{
@@ -60,9 +61,20 @@ public void lock( final String repository, final String path, final LockType loc
public void unlock( final String repository, final String path )
{
final String uri = format( "nexus-it-helper-plugin/uid/lock/%s/unlock/%s", repository, path );
- getNexusClient()
- .serviceResource( uri )
- .delete( ClientResponse.class );
+ try
+ {
+ getNexusClient()
+ .serviceResource( uri )
+ .delete();
+ }
+ catch ( UniformInterfaceException e )
+ {
+ throw getNexusClient().convert( e );
+ }
+ catch ( ClientHandlerException e )
+ {
+ throw getNexusClient().convert( e );
+ }
}
}

0 comments on commit 454c918

Please sign in to comment.