code: private String trimSurroundingSlashes(final String url)
     {
        String result = null;
        if (url != null)
        {
           result = url.trim();
           if (result.startsWith("/"))
           {
              result = result.substring(1);
           }
           if (result.endsWith("/"))
           {
              result = result.substring(0, result.length() - 1);
           }
        }
        return result;
     }
docs: /*
  Helpers