public static void reorderJarEntries( File jarFile )
		throws IOException
	{
		ByteArrayOutputStream outStream = new ByteArrayOutputStream( (int) jarFile.length() + 1000 );

		try( ZipOutputStream zipOutStream = new ZipOutputStream( outStream ) ) {
			// 1st pass: copy .properties files
			copyFiles( zipOutStream, jarFile, name -> name.endsWith( ".properties" ) );

			// 2nd pass: copy other files
			copyFiles( zipOutStream, jarFile, name -> !name.endsWith( ".properties" ) );
		}

		// replace JAR
		Files.write( jarFile.toPath(), outStream.toByteArray(),
			StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING );
	}
Reorders entries in a JAR file so that .properties files are placed before .class files,
which is necessary to workaround an issue in NetBeans 11.3 (and older).
See issues #13 and #93.

@author Karl Tauber
buildSrc/src/main/java/ReorderJarEntries.java