parent
aab160372a
commit
8777e02aa5
|
|
@ -110,15 +110,17 @@ public class RScriptExecutor {
|
|||
|
||||
List<File> tempFiles = new ArrayList<File>();
|
||||
try {
|
||||
File tempLibDir = IOUtils.tempDir("Rlib.", "");
|
||||
tempFiles.add(tempLibDir);
|
||||
File tempLibSourceDir = IOUtils.tempDir("RlibSources.", "");
|
||||
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) {
|
||||
List<String> tempLibraryPaths = new ArrayList<String>();
|
||||
for (RScriptLibrary library: this.libraries) {
|
||||
File tempLibrary = library.writeTemp();
|
||||
File tempLibrary = library.writeLibrary(tempLibSourceDir);
|
||||
tempFiles.add(tempLibrary);
|
||||
tempLibraryPaths.add(tempLibrary.getAbsolutePath());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,4 +57,10 @@ public enum RScriptLibrary {
|
|||
public File writeTemp() {
|
||||
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