File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
csv-validator-core/src/main/scala/uk/gov/nationalarchives/csv/validator Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -218,12 +218,8 @@ object Util {
218218 }
219219
220220 private def contentDir (filepath : String , topLevelFolder : String ): String = {
221- val list = (substitutePath(filepath) split topLevelFolder).toIterator.toList
222- val pathList = if (list.length > 1 ) list.dropRight(1 ) else list
223- val dir = pathList.tail.foldLeft(pathList.head){ case (acc, elem) =>
224- acc + topLevelFolder + elem
225- }
226- FileSystem .file2PlatformIndependent(dir + topLevelFolder)
221+ val substPath = substitutePath(filepath).split(" /" ).toSeq.reverse.dropWhile(! _.equals(topLevelFolder)).reverse.mkString(" /" )
222+ FileSystem .file2PlatformIndependent(substPath)
227223 }
228224
229225 def jointPath : String = {
You can’t perform that action at this time.
0 commit comments