@Test public void testStripLeadingSlash() { RequestPath requestPath = new RequestPath("", "", "", "/opToMatch/abc", null, NO_BLOB_SEGMENT_IDX_SPECIFIED); assertEquals("Should strip leading slash", "opToMatch/abc", requestPath.getOperationOrBlobId(true)); assertEquals("Should not strip leading slash", "/opToMatch/abc", requestPath.getOperationOrBlobId(false)); }
public String getOperationOrBlobId(boolean stripLeadingSlash) { if (stripLeadingSlash) { if (operationOrBlobIdWithoutLeadingSlash == null) { operationOrBlobIdWithoutLeadingSlash = operationOrBlobId.startsWith(PATH_SEPARATOR_STRING) ? operationOrBlobId.substring(1) : operationOrBlobId; } return operationOrBlobIdWithoutLeadingSlash; } else { return operationOrBlobId; } }
RequestPath { public String getOperationOrBlobId(boolean stripLeadingSlash) { if (stripLeadingSlash) { if (operationOrBlobIdWithoutLeadingSlash == null) { operationOrBlobIdWithoutLeadingSlash = operationOrBlobId.startsWith(PATH_SEPARATOR_STRING) ? operationOrBlobId.substring(1) : operationOrBlobId; } return operationOrBlobIdWithoutLeadingSlash; } else { return operationOrBlobId; } } }
RequestPath { public String getOperationOrBlobId(boolean stripLeadingSlash) { if (stripLeadingSlash) { if (operationOrBlobIdWithoutLeadingSlash == null) { operationOrBlobIdWithoutLeadingSlash = operationOrBlobId.startsWith(PATH_SEPARATOR_STRING) ? operationOrBlobId.substring(1) : operationOrBlobId; } return operationOrBlobIdWithoutLeadingSlash; } else { return operationOrBlobId; } } RequestPath(String prefix, String clusterName, String pathAfterPrefixes, String operationOrBlobId,
      SubResource subResource, int blobSegmentIdx); }
RequestPath { public String getOperationOrBlobId(boolean stripLeadingSlash) { if (stripLeadingSlash) { if (operationOrBlobIdWithoutLeadingSlash == null) { operationOrBlobIdWithoutLeadingSlash = operationOrBlobId.startsWith(PATH_SEPARATOR_STRING) ? operationOrBlobId.substring(1) : operationOrBlobId; } return operationOrBlobIdWithoutLeadingSlash; } else { return operationOrBlobId; } } RequestPath(String prefix, String clusterName, String pathAfterPrefixes, String operationOrBlobId,
      SubResource subResource, int blobSegmentIdx); static RequestPath parse(RestRequest restRequest, List<String> prefixesToRemove, String clusterName); static RequestPath parse(String path, Map<String, Object> args, List<String> prefixesToRemove,
      String clusterName); String getPrefix(); String getClusterName(); String getPathAfterPrefixes(); String getOperationOrBlobId(boolean stripLeadingSlash); SubResource getSubResource(); int getBlobSegmentIdx(); boolean matchesOperation(String operation); @Override boolean equals(Object o); @Override String toString(); }
RequestPath { public String getOperationOrBlobId(boolean stripLeadingSlash) { if (stripLeadingSlash) { if (operationOrBlobIdWithoutLeadingSlash == null) { operationOrBlobIdWithoutLeadingSlash = operationOrBlobId.startsWith(PATH_SEPARATOR_STRING) ? operationOrBlobId.substring(1) : operationOrBlobId; } return operationOrBlobIdWithoutLeadingSlash; } else { return operationOrBlobId; } } RequestPath(String prefix, String clusterName, String pathAfterPrefixes, String operationOrBlobId,
      SubResource subResource, int blobSegmentIdx); static RequestPath parse(RestRequest restRequest, List<String> prefixesToRemove, String clusterName); static RequestPath parse(String path, Map<String, Object> args, List<String> prefixesToRemove,
      String clusterName); String getPrefix(); String getClusterName(); String getPathAfterPrefixes(); String getOperationOrBlobId(boolean stripLeadingSlash); SubResource getSubResource(); int getBlobSegmentIdx(); boolean matchesOperation(String operation); @Override boolean equals(Object o); @Override String toString();  }