File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
csv-validator-core/src/main/scala/uk/gov/nationalarchives/csv/validator Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -215,18 +215,9 @@ object Util {
215215 }
216216
217217 private def contentDir (filepath : String , topLevelFolder : String ): String = {
218- val dir = pathSubstitutions.collectFirst{
219- case (subFrom, subTo) if filepath.contains(subFrom) => FileSystem .file2PlatformIndependent(subTo)
220- } getOrElse {
221- (filepath split topLevelFolder).head
222- }
223-
224- val sep = " /"
225- val lastfilePath = dir.split(sep).last
226- if (lastfilePath.equals(topLevelFolder) || lastfilePath.equals(topLevelFolder + sep)) {
227- dir
228- } else
229- FileSystem .file2PlatformIndependent(dir + sep + topLevelFolder)
218+ val dir = (substitutePath(filepath) split topLevelFolder).head
219+ val sep = " /"
220+ FileSystem .file2PlatformIndependent(dir + sep + topLevelFolder)
230221 }
231222
232223 def jointPath : String = {
You can’t perform that action at this time.
0 commit comments