mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-13 02:55:03 +00:00
🤖 format everything with pre-commit by <stirlingbot> (#3374)
Auto-generated by [create-pull-request][1] with **stirlingbot** [1]: https://github.com/peter-evans/create-pull-request Signed-off-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com> Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
This commit is contained in:
parent
a52c81b340
commit
f56403d091
@ -390,7 +390,7 @@ public class KeygenLicenseVerifier {
|
|||||||
// Extract max users and isEnterprise from policy or metadata
|
// Extract max users and isEnterprise from policy or metadata
|
||||||
int users = policyObj.optInt("users", 0);
|
int users = policyObj.optInt("users", 0);
|
||||||
isEnterpriseLicense = policyObj.optBoolean("isEnterprise", false);
|
isEnterpriseLicense = policyObj.optBoolean("isEnterprise", false);
|
||||||
|
|
||||||
if (users > 0) {
|
if (users > 0) {
|
||||||
applicationProperties.getPremium().setMaxUsers(users);
|
applicationProperties.getPremium().setMaxUsers(users);
|
||||||
log.info("License allows for {} users", users);
|
log.info("License allows for {} users", users);
|
||||||
@ -402,7 +402,7 @@ public class KeygenLicenseVerifier {
|
|||||||
users = metadata.optInt("users", 1);
|
users = metadata.optInt("users", 1);
|
||||||
applicationProperties.getPremium().setMaxUsers(users);
|
applicationProperties.getPremium().setMaxUsers(users);
|
||||||
log.info("License allows for {} users (from metadata)", users);
|
log.info("License allows for {} users (from metadata)", users);
|
||||||
|
|
||||||
// Check for isEnterprise flag in metadata
|
// Check for isEnterprise flag in metadata
|
||||||
isEnterpriseLicense = metadata.optBoolean("isEnterprise", false);
|
isEnterpriseLicense = metadata.optBoolean("isEnterprise", false);
|
||||||
} else {
|
} else {
|
||||||
@ -411,7 +411,7 @@ public class KeygenLicenseVerifier {
|
|||||||
log.info("Using default of 1 user for license");
|
log.info("Using default of 1 user for license");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -507,16 +507,16 @@ public class KeygenLicenseVerifier {
|
|||||||
.path("users")
|
.path("users")
|
||||||
.asInt(0);
|
.asInt(0);
|
||||||
applicationProperties.getPremium().setMaxUsers(users);
|
applicationProperties.getPremium().setMaxUsers(users);
|
||||||
|
|
||||||
// Extract isEnterprise flag
|
// Extract isEnterprise flag
|
||||||
isEnterpriseLicense =
|
isEnterpriseLicense =
|
||||||
jsonResponse
|
jsonResponse
|
||||||
.path("data")
|
.path("data")
|
||||||
.path("attributes")
|
.path("attributes")
|
||||||
.path("metadata")
|
.path("metadata")
|
||||||
.path("isEnterprise")
|
.path("isEnterprise")
|
||||||
.asBoolean(false);
|
.asBoolean(false);
|
||||||
|
|
||||||
log.info(applicationProperties.toString());
|
log.info(applicationProperties.toString());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -16,7 +16,7 @@ public class UploadLimitService {
|
|||||||
private ApplicationProperties applicationProperties;
|
private ApplicationProperties applicationProperties;
|
||||||
|
|
||||||
public long getUploadLimit() {
|
public long getUploadLimit() {
|
||||||
String maxUploadSize =
|
String maxUploadSize =
|
||||||
applicationProperties.getSystem().getFileUploadLimit() != null
|
applicationProperties.getSystem().getFileUploadLimit() != null
|
||||||
? applicationProperties.getSystem().getFileUploadLimit()
|
? applicationProperties.getSystem().getFileUploadLimit()
|
||||||
: "";
|
: "";
|
||||||
@ -52,4 +52,4 @@ public class UploadLimitService {
|
|||||||
String pre = "KMGTPE".charAt(exp - 1) + "B";
|
String pre = "KMGTPE".charAt(exp - 1) + "B";
|
||||||
return String.format("%.1f %s", bytes / Math.pow(1024, exp), pre);
|
return String.format("%.1f %s", bytes / Math.pow(1024, exp), pre);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user