You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "quantranhong1999 (via GitHub)" <gi...@apache.org> on 2023/07/07 03:44:56 UTC
[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1632: JAMES-2287 HashBlobId.Factory support encoding type
quantranhong1999 commented on code in PR #1632:
URL: https://github.com/apache/james-project/pull/1632#discussion_r1255208881
##########
server/blob/blob-api/src/main/java/org/apache/james/blob/api/HashBlobId.java:
##########
@@ -29,11 +29,22 @@
import com.google.common.base.Strings;
import com.google.common.hash.HashCode;
import com.google.common.hash.Hashing;
+import com.google.common.io.BaseEncoding;
import com.google.common.io.ByteSource;
public class HashBlobId implements BlobId {
+ private static final String HASH_BLOB_ID_ENCODING_TYPE_PROPERTY = "james.blob.id.hash.encoding";
+ private static final BaseEncoding HASH_BLOB_ID_ENCODING_DEFAULT = BaseEncoding.base64Url();
public static class Factory implements BlobId.Factory {
+ private final BaseEncoding baseEncoding;
+
+ public Factory() {
+ this.baseEncoding = Optional.ofNullable(System.getProperty(HASH_BLOB_ID_ENCODING_TYPE_PROPERTY))
+ .map(Factory::baseEncodingFrom)
+ .orElse(HASH_BLOB_ID_ENCODING_DEFAULT);
Review Comment:
Should be 4 spaces?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org