parent
aab160372a
commit
8777e02aa5
|
|
@ -110,15 +110,17 @@ public class RScriptExecutor {
|
||||||
|
|
||||||
List<File> tempFiles = new ArrayList<File>();
|
List<File> tempFiles = new ArrayList<File>();
|
||||||
try {
|
try {
|
||||||
File tempLibDir = IOUtils.tempDir("Rlib.", "");
|
File tempLibSourceDir = IOUtils.tempDir("RlibSources.", "");
|
||||||
tempFiles.add(tempLibDir);
|
File tempLibInstallationDir = IOUtils.tempDir("Rlib.", "");
|
||||||
|
tempFiles.add(tempLibSourceDir);
|
||||||
|
tempFiles.add(tempLibInstallationDir);
|
||||||
|
|
||||||
StringBuilder expression = new StringBuilder("tempLibDir = '").append(tempLibDir).append("';");
|
StringBuilder expression = new StringBuilder("tempLibDir = '").append(tempLibInstallationDir).append("';");
|
||||||
|
|
||||||
if (this.libraries.size() > 0) {
|
if (this.libraries.size() > 0) {
|
||||||
List<String> tempLibraryPaths = new ArrayList<String>();
|
List<String> tempLibraryPaths = new ArrayList<String>();
|
||||||
for (RScriptLibrary library: this.libraries) {
|
for (RScriptLibrary library: this.libraries) {
|
||||||
File tempLibrary = library.writeTemp();
|
File tempLibrary = library.writeLibrary(tempLibSourceDir);
|
||||||
tempFiles.add(tempLibrary);
|
tempFiles.add(tempLibrary);
|
||||||
tempLibraryPaths.add(tempLibrary.getAbsolutePath());
|
tempLibraryPaths.add(tempLibrary.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,4 +57,10 @@ public enum RScriptLibrary {
|
||||||
public File writeTemp() {
|
public File writeTemp() {
|
||||||
return IOUtils.writeTempResource(new Resource(getResourcePath(), RScriptLibrary.class));
|
return IOUtils.writeTempResource(new Resource(getResourcePath(), RScriptLibrary.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public File writeLibrary(File tempDir) {
|
||||||
|
File libraryFile = new File(tempDir, getLibraryName());
|
||||||
|
IOUtils.writeResource(new Resource(getResourcePath(), RScriptLibrary.class), libraryFile);
|
||||||
|
return libraryFile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue