Skip to content

Commit dd9f512

Browse files
authored
Check if filename is an .ttl file (#43)
1 parent b354472 commit dd9f512

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/eclipse/esmf/ame/repository/strategy/LocalFolderResolverStrategy.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,14 @@ private synchronized void setNamespaces( final Map<String, List<String>> namespa
216216
*/
217217
private Map<String, List<String>> readAllNamespacesFromFolder() {
218218
final String rootSharedFolder = getQualifiedFilePath( StringUtils.EMPTY );
219-
final File file = getFileInstance( rootSharedFolder );
219+
final File file = new File( rootSharedFolder );
220220

221221
if ( !file.exists() ) {
222222
throw new FileNotFoundException( String.format( STORAGE_FOLDER_NOT_EXISTS, rootSharedFolder ) );
223223
}
224224

225-
final List<String> endFilePaths = getEndFilePaths( rootSharedFolder, file );
225+
final List<String> endFilePaths = getEndFilePaths( rootSharedFolder, file ).stream().filter(
226+
path -> path.endsWith( ".ttl" ) ).toList();
226227

227228
final Map<String, List<String>> namespacePathMapping = endFilePaths.stream()
228229
.map( LocalFolderResolverStrategy::transformToValidModelDirectory )

0 commit comments

Comments
 (0)