@@ -87,7 +87,7 @@ public void transform(TransformInvocation transformInvocation)
87
87
88
88
File inputFile = changedInput .getKey ();
89
89
File outputFile =
90
- new File (outputDir , FileUtils . relativePossiblyNonExistingPath (inputFile , inputDir ));
90
+ new File (outputDir , relativePossiblyNonExistingPath (inputFile , inputDir ));
91
91
92
92
switch (changedInput .getValue ()) {
93
93
case REMOVED :
@@ -107,11 +107,27 @@ public void transform(TransformInvocation transformInvocation)
107
107
Iterable <File > files = FileUtils .getAllFiles (inputDir );
108
108
for (File inputFile : files ) {
109
109
110
- File outputFile = new File (outputDir , FileUtils . relativePath (inputFile , inputDir ));
110
+ File outputFile = new File (outputDir , relativePath (inputFile , inputDir ));
111
111
FileUtils .copyFile (inputFile , outputFile );
112
112
}
113
113
}
114
114
}
115
115
}
116
116
}
117
+
118
+ private static String relativePath (File file , File dir ) {
119
+ return relativePossiblyNonExistingPath (file , dir );
120
+ }
121
+
122
+ private static String relativePossiblyNonExistingPath (File file , File dir ) {
123
+ String path = dir .toURI ().relativize (file .toURI ()).getPath ();
124
+ return toSystemDependentPath (path );
125
+ }
126
+
127
+ private static String toSystemDependentPath (String path ) {
128
+ if (File .separatorChar != '/' ) {
129
+ path = path .replace ('/' , File .separatorChar );
130
+ }
131
+ return path ;
132
+ }
117
133
}
0 commit comments