Skip to content

Commit dcf9da3

Browse files
committed
♻️ Better indent MongoRequest
1 parent b6fe250 commit dcf9da3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Diff for: commons/src/main/java/org/restheart/exchange/MongoRequest.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ public static boolean isReservedDocumentId(TYPE type, BsonValue documentId) {
365365
var sdi = documentId.asString().getValue();
366366

367367
if ((type == TYPE.COLLECTION_META && sdi.startsWith(COLL_META_DOCID_PREFIX))
368-
|| (type == TYPE.DB_META && sdi.startsWith(DB_META_DOCID))
369-
|| (type == TYPE.BULK_DOCUMENTS && RESOURCES_WILDCARD_KEY.equals(sdi))
370-
|| (type == TYPE.COLLECTION_SIZE && _SIZE.equalsIgnoreCase(sdi))
371-
|| (type == TYPE.INDEX && _INDEXES.equalsIgnoreCase(sdi))
372-
|| (type == TYPE.COLLECTION_META && _META.equalsIgnoreCase(sdi))
373-
|| (type == TYPE.INVALID && _AGGREGATIONS.equalsIgnoreCase(sdi))
374-
|| (type == TYPE.INVALID && _STREAMS.equalsIgnoreCase(sdi))) {
368+
|| (type == TYPE.DB_META && sdi.startsWith(DB_META_DOCID))
369+
|| (type == TYPE.BULK_DOCUMENTS && RESOURCES_WILDCARD_KEY.equals(sdi))
370+
|| (type == TYPE.COLLECTION_SIZE && _SIZE.equalsIgnoreCase(sdi))
371+
|| (type == TYPE.INDEX && _INDEXES.equalsIgnoreCase(sdi))
372+
|| (type == TYPE.COLLECTION_META && _META.equalsIgnoreCase(sdi))
373+
|| (type == TYPE.INVALID && _AGGREGATIONS.equalsIgnoreCase(sdi))
374+
|| (type == TYPE.INVALID && _STREAMS.equalsIgnoreCase(sdi))) {
375375
return false;
376376
} else {
377377
return DB_META_DOCID.equalsIgnoreCase(sdi) || sdi.startsWith(COLL_META_DOCID_PREFIX);
@@ -511,7 +511,7 @@ private String mongoUriFromPathMatch(String requestPath) {
511511
mongoUri = mongoUri.replaceFirst("^" + Pattern.quote(this.whereUri), "");
512512
}
513513
} else if (!this.whereUri.equals(SLASH)) {
514-
// problem, whereUri can contain regex special chars such as *
514+
// whereUri can contain regex special chars such as *
515515
mongoUri = removeTrailingSlashes(mongoUri.replaceFirst("^" + Pattern.quote(this.whereUri), this.whatUri));
516516
} else {
517517
mongoUri = removeTrailingSlashes(removeTrailingSlashes(this.whatUri) + mongoUri);
@@ -547,7 +547,7 @@ private String mongoUriFromPathTemplateMatch(String requestPath) {
547547
* resources via the mongo-mounts configuration properties
548548
*
549549
* @param mongoResourceUri
550-
* @return
550+
* @return the mapped uri relative to this context.
551551
*/
552552
public String requestPathFromMongoUri(String mongoResourceUri) {
553553
if (this.pathTemplateMatch == null) {
@@ -605,7 +605,7 @@ private String resolveTemplate(String template) {
605605
// eg _whatUri: /{prefix}_db, _whereUri: /{prefix}/*
606606
for (var key : this.pathTemplateMatch.getParameters().keySet()) {
607607
resolvedTemplate = resolvedTemplate.replace("{".concat(key).concat("}"),
608-
this.pathTemplateMatch.getParameters().get(key));
608+
this.pathTemplateMatch.getParameters().get(key));
609609
}
610610
return removeTrailingSlashes(resolvedTemplate);
611611
}
@@ -623,8 +623,8 @@ private String resolveTemplate(String template) {
623623
*/
624624
public boolean isParentAccessible() {
625625
return getType() == TYPE.DB
626-
? getExchange().getRequestPath().split(SLASH).length > 1
627-
: getExchange().getRequestPath().split(SLASH).length > 2;
626+
? getExchange().getRequestPath().split(SLASH).length > 1
627+
: getExchange().getRequestPath().split(SLASH).length > 2;
628628
}
629629

630630
/**

0 commit comments

Comments
 (0)