Search in sources :

Example 31 with IniFile

use of org.hl7.fhir.utilities.IniFile in project org.hl7.fhir.core by hapifhir.

the class BatchLoader method LoadDirectory.

private static void LoadDirectory(String server, String folder, int size) throws IOException, Exception {
    System.out.print("Connecting to " + server + ".. ");
    FHIRToolingClient client = new FHIRToolingClient(server, "fhir/batch-loader");
    System.out.println("Done");
    IniFile ini = new IniFile(Utilities.path(folder, "batch-load-progress.ini"));
    for (File f : new File(folder).listFiles()) {
        if (f.getName().endsWith(".json") || f.getName().endsWith(".xml")) {
            if (!ini.getBooleanProperty("finished", f.getName())) {
                sendFile(client, f, size, ini);
            }
        }
    }
}
Also used : FHIRToolingClient(org.hl7.fhir.dstu3.utils.client.FHIRToolingClient) IniFile(org.hl7.fhir.utilities.IniFile) File(java.io.File) IniFile(org.hl7.fhir.utilities.IniFile)

Aggregations

IniFile (org.hl7.fhir.utilities.IniFile)27 File (java.io.File)16 TextFile (org.hl7.fhir.utilities.TextFile)12 ArrayList (java.util.ArrayList)7 CSFile (org.hl7.fhir.utilities.CSFile)6 FileNotFoundException (java.io.FileNotFoundException)5 IOException (java.io.IOException)5 Date (java.util.Date)5 ResourceDefn (org.hl7.fhir.definitions.model.ResourceDefn)5 FileInputStream (java.io.FileInputStream)4 FHIRException (org.hl7.fhir.exceptions.FHIRException)4 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)4 RandomAccessFile (java.io.RandomAccessFile)3 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)3 JsonObject (com.google.gson.JsonObject)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 FileOutputStream (java.io.FileOutputStream)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 ParseException (java.text.ParseException)2