From d58376d025969daf38db630fd4d6497c903b84b1 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Sat, 21 Jun 2014 19:49:55 +0000 Subject: [PATCH] Updated Processor utility functions to add support for backslashes in paths. --- src/main/com/jdblabs/jlp/Processor.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/com/jdblabs/jlp/Processor.groovy b/src/main/com/jdblabs/jlp/Processor.groovy index c784ef6..8a7c51a 100644 --- a/src/main/com/jdblabs/jlp/Processor.groovy +++ b/src/main/com/jdblabs/jlp/Processor.groovy @@ -128,7 +128,7 @@ public class Processor { // Get the relative path as path elements. def relPath = getRelativeFilepath(inputRoot, file) - def pathParts = relPath.split('/') as List + def pathParts = relPath.split('/|\\\\') as List // We will skip binary files and files we know nothing about. def fileType = sourceTypeForFile(file) @@ -304,8 +304,8 @@ public class Processor { if (!root.isDirectory()) root= root.parentFile /// Split both paths into their individual parts. - def rootPath = root.canonicalPath.split('/') - def filePath = file.canonicalPath.split('/') + def rootPath = root.canonicalPath.split('/|\\\\') + def filePath = file.canonicalPath.split('/|\\\\') def relativePath = [] @@ -331,8 +331,8 @@ public class Processor { * @org jlp.jdb-labs.com/Processor/getCommonParent */ public static File getCommonParent(File file1, File file2) { - def path1 = file1.canonicalPath.split('/') - def path2 = file2.canonicalPath.split('/') + def path1 = file1.canonicalPath.split('/|\\\\') + def path2 = file2.canonicalPath.split('/|\\\\') def newPath = [] // build new commonPath based on matching paths so far