use of coldfusion.server.ServiceException in project Lucee by lucee.
the class DataSourceServiceImpl method getDrivers.
@Override
public Struct getDrivers() throws ServiceException, SecurityException {
checkReadAccess();
Struct rtn = new StructImpl();
Struct driver;
try {
Resource luceeContext = ResourceUtil.toResourceExisting(pc(), "/lucee/admin/dbdriver/");
Resource[] children = luceeContext.listResources(new ExtensionResourceFilter(Constants.getComponentExtensions()));
String name;
for (int i = 0; i < children.length; i++) {
driver = new StructImpl();
name = ListFirst.call(pc(), children[i].getName(), ".");
driver.setEL(KeyConstants._name, name);
driver.setEL("handler", children[i].getName());
rtn.setEL(name, driver);
}
} catch (ExpressionException e) {
throw new ServiceException(e.getMessage());
}
return rtn;
}
Aggregations