Example #1
0
 @Override
 public void delete(final Location location) throws IOException {
   try {
     getNexusClient().uri(CONTENT_PREFIX + location.toContentPath()).delete();
   } catch (UniformInterfaceException e) {
     throw getNexusClient()
         .convert(
             new ContextAwareUniformInterfaceException(e.getResponse()) {
               @Override
               public String getMessage(final int status) {
                 if (status == Response.Status.NOT_FOUND.getStatusCode()) {
                   return String.format("Inexistent path: %s", location);
                 }
                 return null;
               }
             });
   } catch (ClientHandlerException e) {
     throw getNexusClient().convert(e);
   }
 }
Example #2
0
 protected String toUri(final Location location, final Directive directive) {
   String uri = CONTENT_PREFIX + location.toContentPath();
   if (directive != null) {
     switch (directive) {
       case LOCAL_ONLY:
         uri += "?isLocal";
         break;
       case REMOTE_ONLY:
         uri += "?isRemote";
         break;
       case GROUP_ONLY:
         uri += "?asGroupOnly";
         break;
       case AS_EXPIRED:
         uri += "?asExpired";
         break;
       default:
         break;
     }
   }
   return uri;
 }