Skip to content

Commit

Permalink
JHP-83: Fix issue with project resources not being mounted. Caused by…
Browse files Browse the repository at this point in the history
… XNAT-7903.
  • Loading branch information
andylassiter committed Apr 26, 2024
1 parent ac8761a commit 3527906
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- [JHP-83] - Fix issue with project resources not being mounted. Caused by XNAT-7903.

## [1.1.0] - 2024-03-04

### Added
Expand Down Expand Up @@ -47,3 +51,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[JHP-73]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-73
[JHP-74]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-74
[JHP-77]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-77
[JHP-83]: https://radiologics.atlassian.net/jira/software/c/projects/JHP/issues/JHP-83
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,24 @@ public Map<String, String> getProjectPaths(final UserI user, final List<String>
if (eventTrackingId != null) {
Map<Path, Path> allSharedPaths = FileUtils.getAllSharedPaths(projectId, user, true, true, true, true);
if (allSharedPaths.isEmpty()) {
// Hot fix. I don't like the code duplication, but it resolves the issue safely for now.
// Need to figure out what to do with stored searches before refactoring.
final Path projectDirectory = Paths.get(xnatProjectdata.getRootArchivePath() + xnatProjectdata.getCurrentArc());
if (Files.exists(projectDirectory)) {
projectPaths.put("/data/projects/" + projectId + "/experiments", projectDirectory.toString());
}

// Project resources
final Path resourceDirectory = Paths.get(xnatProjectdata.getRootArchivePath() + "/resources");
if (Files.exists(resourceDirectory)) {
projectPaths.put("/data/projects/" + projectId + "/resources", resourceDirectory.toString());
}

// Subject resources
final Path subjectResourceDirectory = Paths.get(xnatProjectdata.getRootArchivePath() + "/subjects");
if (Files.exists(subjectResourceDirectory)) {
projectPaths.put("/data/projects/" + projectId + "/subjects", subjectResourceDirectory.toString());
}
} else {
Path sharedLinksDirectory = Paths.get(JupyterHubPreferences.SHARED_PROJECT_STRING, eventTrackingId);
projectPaths.put("/data/projects/" + projectId, String.valueOf(FileUtils.createDirectoryForSharedData(allSharedPaths, sharedLinksDirectory)));
Expand Down

0 comments on commit 3527906

Please sign in to comment.