Skip to content

Commit

Permalink
ALS-5387: Remove stack from resources table
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Dec 7, 2023
1 parent 7f645ee commit 2ab8d49
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import edu.harvard.dbmi.avillach.data.entity.Resource;

import java.util.Optional;
import java.util.UUID;

@Transactional
Expand All @@ -15,5 +16,13 @@ protected ResourceRepository() {
super(Resource.class);
}


private Optional<String> targetStack = Optional.ofNullable(System.getProperty("TARGET_STACK", null));

public Resource getById(UUID id) {
Resource resource = super.getById(id);
targetStack.ifPresent(stack -> {
resource.setResourceRSPath(resource.getResourceRSPath().replace("___target_stack___", stack));
});
return resource;
}
}

0 comments on commit 2ab8d49

Please sign in to comment.