public static String extractCollectionFromPath(String path){
  String extractedCollectionName=null;
  String pathModified=removeFromEndOfString(path,SLASH);
  String[] pathSegments=pathModified.split("/");
  if (pathSegments.length > 0) {
    extractedCollectionName=pathSegments[pathSegments.length - 1];
  }
  return extractedCollectionName;
}

public static String extractCollectionFromPath ( String path ) { String extractedCollectionName = null ; String pathModified = removeFromEndOfString ( path , SLASH ) ; String [ ] pathSegments = pathModified . split ( "/" ) ; if ( pathSegments . length > 0 ) { extractedCollectionName = pathSegments [ pathSegments . length - 1 ] ; } return extractedCollectionName ; }
extracts the collection name from the given path . the collection name is known to be the last segment of the path
