Fix broken build
After I50dc72bf5d1c662c26ec03b8875bb5b52fa2f2a9, the build of this
plugin was broken.
Change-Id: I1cbb1547cda9b5df28d8adfd9b2f75a5ebfbe619
diff --git a/src/main/java/com/googlesource/gerrit/plugins/imagare/PostImage.java b/src/main/java/com/googlesource/gerrit/plugins/imagare/PostImage.java
index 5b58590..f47b0a6 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/imagare/PostImage.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/imagare/PostImage.java
@@ -155,7 +155,7 @@
private String storeImage(ProjectControl pc, byte[] content, String fileName)
throws AuthException, IOException, ResourceConflictException {
- long maxSize = getEffectiveMaxObjectSizeLimit(pc.getProjectState());
+ long maxSize = pc.getProjectState().getEffectiveMaxObjectSizeLimit().value;
// maxSize == 0 means that there is no limit
if (maxSize > 0 && content.length > maxSize) {
throw new ResourceConflictException("image too large");
@@ -246,17 +246,6 @@
return url.toString();
}
- private long getEffectiveMaxObjectSizeLimit(ProjectState p) {
- long global = cfg.getLong("receive", "maxObjectSizeLimit", 0);
- long local = p.getMaxObjectSizeLimit();
- if (global > 0 && local > 0) {
- return Math.min(global, local);
- } else {
- // zero means "no limit", in this case the max is more limiting
- return Math.max(global, local);
- }
- }
-
public static class ImageInfo {
public String url;