- File executionDir = new File(baseDir.getPath() + File.separator
- + executionContext.getUuid());
- if (!executionDir.exists())
- executionDir.mkdirs();
- return new File(executionDir.getPath() + File.separator + relativePath);
+ Assert.notNull(executionContext, "execution context is null");
+
+ if (withExecutionSubdirectory) {
+ String path = baseDir.getPath() + File.separator
+ + sdf().format(executionContext.getCreationDate())
+ + executionContext.getUuid();
+ File executionDir = new File(path);
+
+ return new File(executionDir.getPath() + File.separator
+ + relativePath.replace('/', File.separatorChar));
+ } else {
+ return new File(baseDir.getPath() + File.separator
+ + relativePath.replace('/', File.separatorChar));
+ }
+ }
+
+ protected String removeFilePrefix(String url) {
+ if (url.startsWith("file:"))
+ return url.substring("file:".length());
+ else if (url.startsWith("reference:file:"))
+ return url.substring("reference:file:".length());
+ else
+ return url;