File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
core/esmf-aspect-meta-model-java/src
main/java/org/eclipse/esmf/aspectmodel/resolver/fs
test/java/org/eclipse/esmf/aspectmodel/resolver/fs Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,17 @@ public Stream<Path> paths() {
51
51
52
52
public abstract Path directoryForNamespace ( final AspectModelUrn urn );
53
53
54
+ /**
55
+ * Determines the aspect model file for the given {@link AspectModelUrn}.
56
+ *
57
+ * <p>Constructs the file path by resolving the namespace directory.
58
+ * Validates the file using its canonical path.
59
+ *
60
+ * <p>Returns an empty file if the resolution fails.
61
+ *
62
+ * @param urn the {@link AspectModelUrn} representing the aspect model.
63
+ * @return the resolved {@link File}, or an empty file if resolution fails.
64
+ */
54
65
public File determineAspectModelFile ( final AspectModelUrn urn ) {
55
66
Path path = directoryForNamespace ( urn ).resolve ( urn .getName () + ".ttl" );
56
67
return resolveByCanonicalPath ( path );
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ void resolveByCanonicalPathShouldReturnEmptyFileWhenCanonicalPathDoesNotMatch()
58
58
}
59
59
60
60
@ Test
61
- void resolveByCanonicalPathShouldReturnEmptyFileWhenIOExceptionOccurs () throws Exception {
61
+ void resolveByCanonicalPathShouldReturnEmptyFileWhenIoExceptionOccurs () throws Exception {
62
62
Path pathCausingIOException = Paths .get ( "pathCausingIOException" );
63
63
64
64
File result = invokeResolveByCanonicalPath ( pathCausingIOException );
You can’t perform that action at this time.
0 commit comments