@@ -156,7 +156,7 @@ static void createJar(String inputDir, String output) throws IOException {
156
156
Manifest manifest = new Manifest ();
157
157
manifest .getMainAttributes ().put (Attributes .Name .MANIFEST_VERSION , "1.0" );
158
158
JarOutputStream target = new JarOutputStream (new FileOutputStream (output ), manifest );
159
- addFileJar (inputDir , new File (inputDir ), target );
159
+ addFileJar (inputDir . replace ( " \\ " , "/" ) , new File (inputDir ), target );
160
160
target .close ();
161
161
}
162
162
@@ -167,7 +167,7 @@ private static void addFileJar(String root, File source, JarOutputStream target)
167
167
{
168
168
if (source .isDirectory ())
169
169
{
170
- String name = source .getPath ().replace (root , "" ).replace (" \\ " , "/ " );
170
+ String name = source .getPath ().replace (" \\ " , "/ " ).replace (root , "" );
171
171
if (!name .isEmpty ())
172
172
{
173
173
if (!name .endsWith ("/" ))
@@ -182,7 +182,7 @@ private static void addFileJar(String root, File source, JarOutputStream target)
182
182
return ;
183
183
}
184
184
185
- JarEntry entry = new JarEntry (source .getPath ().replace (root , "" ).replace (" \\ " , "/ " ));
185
+ JarEntry entry = new JarEntry (source .getPath ().replace (" \\ " , "/ " ).replace (root , "" ));
186
186
entry .setTime (source .lastModified ());
187
187
target .putNextEntry (entry );
188
188
in = new BufferedInputStream (new FileInputStream (source ));
0 commit comments