fix BOM in java files

This commit is contained in:
Grahame Grieve 2023-01-17 12:49:14 +11:00
parent 8a53aaffad
commit 7b99037199
346 changed files with 399 additions and 345 deletions

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.misc;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
public class BOMRemover {
public static void main(String[] args) throws FileNotFoundException, IOException {
new BOMRemover().execute(new File(args[0]));
}
private void execute(File f) throws FileNotFoundException, IOException {
if (f.isDirectory()) {
for (File file : f.listFiles()) {
execute(file);
}
} else if (f.getName().endsWith(".java")) {
String src = fileToString(f);
String s = Utilities.stripBOM(src);
if (!s.equals(src)) {
System.out.println("Remove BOM from "+f.getAbsolutePath());
TextFile.stringToFile(s, f, false);
}
}
}
public static String fileToString(File f) throws FileNotFoundException, IOException {
return streamToString(new FileInputStream(f));
}
public static String streamToString(InputStream input) throws IOException {
InputStreamReader sr = new InputStreamReader(input, "UTF-8");
StringBuilder b = new StringBuilder();
//while (sr.ready()) { Commented out by Claude Nanjo (1/14/2014) - sr.ready() always returns false - please remove if change does not impact other areas of codebase
int i = -1;
while((i = sr.read()) > -1) {
char c = (char) i;
b.append(c);
}
sr.close();
return b.toString();
}
}

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r4.model;
package org.hl7.fhir.r4.model;

Some files were not shown because too many files have changed in this diff Show More