Skip to content
Merged
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
9 changes: 6 additions & 3 deletions obp-api/src/main/scala/code/api/util/Glossary.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3514,8 +3514,11 @@ object Glossary extends MdcLoggable {
}

private def getListOfFiles(): List[File] = {
val glossaryPath = new File(getClass.getResource("").toURI.toString.replaceFirst("target/.*", "").replace("file:", ""),
"/src/main/resources/docs/glossary")
import java.net.URLDecoder
import java.nio.charset.StandardCharsets
val resourceUrl = getClass.getClassLoader.getResource("docs/glossary")
val resourcePath = URLDecoder.decode(resourceUrl.getPath, StandardCharsets.UTF_8.name())
val glossaryPath = new File(resourcePath)
logger.info(s"|---> Glossary path: $glossaryPath")

if (glossaryPath.exists && glossaryPath.isDirectory) {
Expand All @@ -3525,7 +3528,7 @@ object Glossary extends MdcLoggable {
.filter(_.getName.endsWith(".md"))
.toList
} else {
logger.error(s"Do not have any files under glossary path ($glossaryPath), please double check the folder: obp-api/src/main/resources/docs/glossary")
logger.error(s"Do not have any files under glossary path ($glossaryPath), please double check the folder path: $glossaryPath")
List.empty[File]
}
}
Expand Down