Skip to content

Commit

Permalink
Update semantic
Browse files Browse the repository at this point in the history
  • Loading branch information
sven1103 committed Apr 16, 2024
1 parent 56646b4 commit 59463c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/main/java/life/qbic/data/processing/Provenance.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ public class Provenance {
@JsonProperty("origin")
public String originPath;

/**
*
*/
@JsonProperty("user")
public String userPath;
public String userWorkDirectoryPath;

/**
* The current location identifier of the dataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ private void moveBackToOrigin(File taskDir, Provenance provenance, String reason
var errorFile = taskDir.toPath().resolve("error.txt").toFile();
errorFile.createNewFile();
Files.writeString(errorFile.toPath(), reason);
Paths.get(provenance.userPath).resolve(usersErrorDirectory).toFile().mkdir();
Paths.get(provenance.userWorkDirectoryPath).resolve(usersErrorDirectory).toFile().mkdir();
Files.move(taskDir.toPath(),
Paths.get(provenance.userPath).resolve(usersErrorDirectory).resolve(taskDir.getName()));
Paths.get(provenance.userWorkDirectoryPath).resolve(usersErrorDirectory).resolve(taskDir.getName()));
} catch (IOException e) {
LOG.error("Cannot move task to user intervention: %s".formatted(provenance.originPath), e);
moveToSystemIntervention(taskDir, e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void writeProvenanceInformation(Path taskDir, Path newLocation,
provenance.originPath = request.origin().toString();
provenance.history = new ArrayList<>();
provenance.history.add(newLocation.toString());
provenance.userPath = String.valueOf(request.userPath());
provenance.userWorkDirectoryPath = String.valueOf(request.userPath());
ObjectMapper mapper = new ObjectMapper();
mapper.writerWithDefaultPrettyPrinter()
.writeValue(taskDir.resolve("provenance.json").toFile(), provenance);
Expand Down

0 comments on commit 59463c3

Please sign in to comment.