use of org.knime.workbench.repository.model.CustomRepositoryManager in project knime-core by knime.
the class DefaultRepositoryView method init.
/**
* {@inheritDoc}
*/
@Override
public void init(final IViewSite site) throws PartInitException {
super.init(site);
m_manager = null;
Location loc = Platform.getInstallLocation();
if (loc == null) {
LOGGER.error("Cannot detected KNIME installation directory");
return;
} else if (!loc.getURL().getProtocol().equals("file")) {
LOGGER.error("KNIME installation directory is not local");
return;
}
File instDir = new File(loc.getURL().getPath());
File customDefinition = new File(instDir, DEFINITION_FILE);
if (customDefinition.exists()) {
try {
m_manager = new CustomRepositoryManager(customDefinition);
setPartName(m_manager.getCustomName());
} catch (Exception ex) {
throw new PartInitException("Could not load custom repository content", ex);
}
}
}
Aggregations