Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Let RIOHandler handle R outputs which are absolute file paths
Browse files Browse the repository at this point in the history
RIOHandler cannot handle outputs with an absolute file which reside outside
the actual working directory. However, this may a valid use case as R scripts
should be free to either store outputs within a local directory or completely
elsewhere in the system.

The full file handle created by the R output result string can  be used instead
of a file handle based on the basename. However, as this is true at least for
GenericFileDataBinding or GenericFileDataWithGTBinding types. Other types may
require the file handle based on basename.

Resolves: #274
  • Loading branch information
ridoo committed Mar 28, 2019
1 parent 9cc4157 commit 2e65542
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,16 @@ public IData parseOutput(RConnection connection,

RAnnotation currentAnnotation = list.get(0);
log.debug("Current annotation: {}", currentAnnotation);
// extract filename from R

String filename = new File(result.asString()).getName();
// extract filename from R
String resultString = result.asString();
File resultFile = new File(resultString);
String filename = resultFile.getName();

if (iClass.equals(GenericFileDataBinding.class) || iClass.equals(GenericFileDataWithGTBinding.class)) {
log.debug("Creating output with {} for file {}", iClass.getName(), filename);
log.debug("Creating output with {} for file {}", iClass.getName(), resultString);
String mimeType = "application/unknown";

File resultFile = new File(filename);
log.debug("Loading file " + resultFile.getAbsolutePath());

if ( !resultFile.isAbsolute()) {
Expand Down

0 comments on commit 2e65542

Please sign in to comment.