Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ MCR.ACL.AccessKey.Secret.Hashing=MCR.ACL.AccessKey.Secret.Storage.Mode
MCR.ACL.AccessKey.Secret.Hashing.Iterations=MCR.ACL.AccessKey.Secret.Storage.Mode.Hash.Iterations
MCR.ACL.AccessKey.Secret.Storage.Mode=MCR.ACL.AccessKey.Service.SecretProcessor.Class
MCR.ACL.AccessKey.Secret.Storage.Mode.Hash.Iterations=MCR.ACL.AccessKey.SecretProcessor.Hash.HashIterations
MCR.Crypt.Cipher.(\S+).class=MCR.Crypt.Cipher.$1.Class
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ MCR.ACL.AccessKey.Service.SecretProcessor.Class=org.mycore.mcr.acl.accesskey.ser
# Hash settings
MCR.ACL.AccessKey.SecretProcessor.Hash.HashIterations=1000
# Crypt settings
MCR.Crypt.Cipher.accesskey.class=org.mycore.crypt.MCRAESCipher
MCR.Crypt.Cipher.accesskey.Class=org.mycore.crypt.MCRAESCipher
MCR.Crypt.Cipher.accesskey.EnableACL=false
# MCR.Crypt.Cipher.accesskey.KeyFile=
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public static MCRCondition parse(Element xml) {
}

static MCRCondition build(String type) {
MCRCondition condition = MCRConfiguration2.getInstanceOfOrThrow(MCRCondition.class, CONDITION_PREFIX + type);
MCRCondition condition = MCRConfiguration2.getInstanceOfOrThrow(MCRCondition.class,
CONDITION_PREFIX + type + ".Class");
if (LOGGER.isDebugEnabled() && condition instanceof MCRCombinedCondition combCond) {
combCond.setDebug(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
*
* New rules need to be registered in mycore.properties as follows:
*
* MCR.Access.Facts.Condition.{type}={class}
* e.g. MCR.Access.Facts.Condition.ip=org.mycore.access.facts.condition.fact.MCRIPCondition
* MCR.Access.Facts.Condition.{type}.Class={class}
* e.g. MCR.Access.Facts.Condition.ip.Class=org.mycore.access.facts.condition.fact.MCRIPCondition
*
* @author Robert Stephan
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected MCRCondition<?> parseElement(Element e) {
}

private MCRCondition<MCRAccessData> getIPClause(String value) {
MCRIPCondition ipCond = MCRConfiguration2.getInstanceOfOrThrow(MCRIPCondition.class, "MCR.RuleParser.ip");
MCRIPCondition ipCond = MCRConfiguration2.getInstanceOfOrThrow(MCRIPCondition.class, "MCR.RuleParser.ip.Class");
ipCond.set(value);
return ipCond;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor;
import org.hibernate.jpa.boot.spi.PersistenceXmlParser;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.common.config.MCRInstanceName;
import org.mycore.common.config.instantiator.MCRInstanceName;
import org.mycore.common.events.MCRStartupHandler.AutoExecutable;
import org.mycore.resource.MCRResourceResolver;
import org.mycore.resource.provider.MCRResourceProvider;
Expand Down
12 changes: 5 additions & 7 deletions mycore-base/src/main/java/org/mycore/common/MCRClassTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,18 @@ public static Object loadClassFromURL(File file, String className)

/**
* Loads a class via default ClassLoader or <code>Thread.currentThread().getContextClassLoader()</code>.
* @param classname Name of class
* @param className Name of class
* @param <T> Type of Class
* @return the initialized class
* @throws ClassNotFoundException if both ClassLoader cannot load the Class
*/
public static <T> Class<? extends T> forName(String classname) throws ClassNotFoundException {
@SuppressWarnings("unchecked")
Class<? extends T> forName;
@SuppressWarnings("unchecked")
public static <T> Class<? extends T> forName(String className) throws ClassNotFoundException {
try {
forName = (Class<? extends T>) Class.forName(classname);
return (Class<? extends T>) Class.forName(className);
} catch (ClassNotFoundException cnfe) {
forName = (Class<? extends T>) Class.forName(classname, true, extendedClassLoader);
return (Class<? extends T>) Class.forName(className, true, extendedClassLoader);
}
return forName;
}

/**
Expand Down
Loading
Loading