Im using handle api for security
It has a really bad implementation for the factory, this is their source
Code:
public static IDSvcInterface getInterface(String s)
throws BadConfigurationFileException, InvalidSubclassException
{
try
{
File file = new File(s);
StreamTable streamtable = new StreamTable();
streamtable.readFromFile(new File(file, "config.dct"));
String s1 = streamtable.getStr("IDSvcInterface_class");
Class class1 = Class.forName(s1);
Constructor constructor = class1.getConstructor(new Class[] {
Class.forName("java.lang.String")
});
return (IDSvcInterface)constructor.newInstance(new Object[] {
s
});
}
I didnt like them expecting a folder name and hardcoding the config.dct file inside their method getInterface(), so I literally copied this factory in my app and changed their implementation by one line
File f = new File(filename)
where I want to pass my own fully qualified filename. I can pass on Resource but I think Im just ending up doing a zillion things rather than what I want to do.
"I just want to give an absolute filename at runtime and I want Spring to give it"
Cant this be simple