Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #60 by ensuring we are loading existing resources instead of call… #63

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ target
*.war
*.ear

# Don't ignore gradle-wrapper distributed in project
!/gradle/wrapper/gradle-wrapper.jar

# Serverless directories
.serverless
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ subprojects {
systemProperty "java.library.path", 'build/libs'
}

// Log exceptions of any unit test failures to stdout
test.testLogging {
events "failed"
exceptionFormat "full"
}

//ensures that idea sees the generated source files in the src classpath
def generated = new File(buildDir, "generated/source/apt/main")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ public BinaryServiceImpl(final ResourceTripleDao dao) {
protected FedoraBinary create(final URI identifier) {
return new FedoraBinaryImpl(identifier, getResourceTripleDao());
}

@Override
protected FedoraBinary load(final URI identifier) {
return new FedoraBinaryImpl(identifier, getResourceTripleDao());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ protected Container create(final URI identifier) {
return new ContainerImpl(identifier, dao);
}

@Override
protected Container load(final URI identifier) {
LOGGER.debug("Load: {}", identifier);
final ResourceTripleDao dao = getResourceTripleDao();
return new ContainerImpl(identifier, dao);
}

/**
* Get system generated triples for this resource
* @param identifier resource URI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public boolean exists(final URI identifier) {
@Override
public T find(final URI identifier) {
if (exists(identifier)) {
return create(identifier);
return load(identifier);
} else {
return null;
}
Expand Down Expand Up @@ -63,4 +63,13 @@ protected ResourceTripleDao getResourceTripleDao() {
* @return
*/
abstract protected T create(final URI identifier);


/**
* load existing resource
*
* @param identifier
* @return
*/
abstract protected T load(final URI identifier);
}