}\r
}\r
\r
- private GroovyClassLoader createGroovyClassLoader(URLClassLoader stepsClassLoader, String excludeFileName)\r
- throws FileNotFoundException {\r
- String stepsDir = systemConfig.getConfig(DIR_STEPS);\r
-\r
- Set<File> sharedFiles = getJavaFileList(Paths.get(stepsDir, "shared"), excludeFileName);\r
- Set<File> libFiles = getJavaFileList(Paths.get(stepsDir), excludeFileName);\r
- libFiles.addAll(sharedFiles);\r
-\r
- GroovyClassLoader gcl = new GroovyClassLoader(stepsClassLoader) {\r
-\r
- @Override\r
- protected CompilationUnit createCompilationUnit(CompilerConfiguration config, CodeSource source) {\r
- CompilationUnit result = new CompilationUnit(config, source, this);\r
- libFiles.forEach(f -> result.addSource(f));\r
- //loadStepSources(result, Paths.get(stepsDir, "shared"));\r
- //loadStepSources(result, Paths.get(stepsDir));\r
- return result;\r
- }\r
-\r
- };\r
- return gcl;\r
- }\r
-\r
private GroovyClassLoader createGroovyClassLoader(URLClassLoader stepsClassLoader) throws FileNotFoundException {\r
String stepsDir = systemConfig.getConfig(DIR_STEPS);\r
\r
Set<File> libFiles = getJavaFileList(Paths.get(stepsDir), null);\r
libFiles.addAll(sharedFiles);\r
\r
+ // for (File f : libFiles) {\r
+ // logger.info("GroovyClassLoader source {}", f.getAbsolutePath());\r
+ // }\r
+\r
GroovyClassLoader gcl = new GroovyClassLoader(stepsClassLoader) {\r
\r
@Override\r
Class<IJobStep> stepClass = null;\r
\r
if (isGroovyClass) {\r
- //kozos classloader hasznalata\r
- //GroovyClassLoader gcl = createGroovyClassLoader(stepsClassLoader, stepUnitName);\r
-\r
stepClass = (Class<IJobStep>) loadClassFromSourceCode(groovyClassLoader, stepUnitName);\r
} else\r
stepClass = (Class<IJobStep>) stepsClassLoader.loadClass(stepUnitName);\r
\r
String stepsDir = systemConfig.getConfig(DIR_STEPS);\r
Path path = Paths.get(stepsDir, className);\r
- if (!path.toFile().exists())\r
+ File classFile = null;\r
+\r
+ //Windows alatt az eleresi utak irasmodja egyforma kell legyen.\r
+ //A GroovyClassLoader\r
+ //ld. createGroovyClassLoader a new File(path.toFile().getCanonicalPath())-al operal.\r
+ classFile = new File(path.toFile().getCanonicalPath());\r
+ logger.info("Class path is normalized to {}", classFile.getCanonicalPath());\r
+\r
+ if (!classFile.exists())\r
return result;\r
\r
- result = gcl.parseClass(path.toFile());\r
+ result = gcl.parseClass(classFile);\r
if (result != null)\r
logger.info("Class for {} successfully loaded", className);\r
return result;\r
&& file.getFileName().toString().endsWith(".java");\r
try (Stream<Path> stream = Files.list(path)) {\r
stream.filter(filter).forEach(p -> {\r
+\r
+ boolean add = false;\r
if (excludeFileName == null)\r
- result.add(p.toFile());\r
+ add = true;\r
else if (!excludeFileName.equals(p.getFileName().toString()))\r
- result.add(p.toFile());\r
+ add = true;\r
+\r
+ try {\r
+ if (add) {\r
+ //ha a betoltendo osztaly eleresi utja korabban mas kapitalissal kerul feldolgozasra, hibat kapunk\r
+ //ld. loadClassFromSourceCode\r
+ File classFile = new File(p.toFile().getCanonicalPath());\r
+ result.add(classFile);\r
+ }\r
+ } catch (IOException e) {\r
+ logger.catching(e);\r
+ }\r
\r
});\r
} catch (Exception e) {\r
return result;\r
}\r
\r
- private void loadStepSources(CompilationUnit compilationUnit, Path path) {\r
- if (path.toFile().isDirectory()) {\r
- Predicate<Path> filter = file -> !Files.isDirectory(file)\r
- && file.getFileName().toString().endsWith(".java");\r
- try (Stream<Path> stream = Files.list(path)) {\r
- stream.filter(filter).forEach(p -> {\r
- compilationUnit.addSource(p.toFile());\r
- });\r
- } catch (Exception e) {\r
- }\r
-\r
- }\r
- }\r
-\r
private void loadTemplate(Path config) {\r
InputStream stream = null;\r
try {\r