use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class JobJavaScriptsManager method addLog4jSetting.
protected void addLog4jSetting(ExportFileResource resource) {
try {
if (Log4jPrefsSettingManager.getInstance().isLog4jEnable() && GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
ITalendProcessJavaProject talendProcessJavaProject = processService.getTalendProcessJavaProject();
if (talendProcessJavaProject != null) {
IFolder resourcesFolder = talendProcessJavaProject.getResourcesFolder();
IFile log4jFile = resourcesFolder.getFile(Log4jPrefsConstants.LOG4J_FILE_NAME);
if (log4jFile.exists()) {
List<URL> log4jFileUrls = new ArrayList<URL>();
log4jFileUrls.add(FileLocator.toFileURL(log4jFile.getLocationURI().toURL()));
resource.addResources(PATH_SEPARATOR, log4jFileUrls);
}
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
Aggregations