@@ -349,15 +349,19 @@ public static SqrlConfig create(ErrorCollector errors, int version) {
349
349
350
350
public static TableConfigImpl fromFilesTableConfig (@ NonNull Name name , ErrorCollector errors ,
351
351
@ NonNull List <Path > files ) {
352
- return new TableConfigImpl (name , fromFiles (errors , "/jsonSchema/tableConfig.json" , files ));
352
+ return new TableConfigImpl (name , getPackageConfig (errors , "/jsonSchema/tableConfig.json" , files ));
353
+ }
354
+
355
+ public static PackageJson getDefaultPackageJson (ErrorCollector errors ) {
356
+ return fromFilesPackageJson (errors , List .of ());
353
357
}
354
358
355
359
public static PackageJson fromFilesPackageJson (ErrorCollector errors , @ NonNull List <Path > files ) {
356
- return new PackageJsonImpl (fromFiles (errors , "/jsonSchema/packageSchema.json" , files ));
360
+ return new PackageJsonImpl (getPackageConfig (errors , "/jsonSchema/packageSchema.json" , files ));
357
361
}
358
362
359
363
public static PackageJson fromFilesPublishPackageJson (ErrorCollector errors , @ NonNull List <Path > files ) {
360
- return new PackageJsonImpl (fromFiles (errors , "/jsonSchema/publishPackageSchema.json" , files ));
364
+ return new PackageJsonImpl (getPackageConfig (errors , "/jsonSchema/publishPackageSchema.json" , files ));
361
365
}
362
366
363
367
public static boolean validateJsonFile (Path jsonFilePath , String schemaResourcePath ,
@@ -398,10 +402,10 @@ public static boolean validateJsonFile(Path jsonFilePath, String schemaResourceP
398
402
}
399
403
400
404
public static SqrlConfig fromFiles (ErrorCollector errors , @ NonNull Path firstFile ) {
401
- return fromFiles (errors , null , List .of (firstFile ));
405
+ return getPackageConfig (errors , null , List .of (firstFile ));
402
406
}
403
407
404
- public static SqrlConfig fromFiles (ErrorCollector errors , String jsonSchemaResource , @ NonNull List <Path > files ) {
408
+ public static SqrlConfig getPackageConfig (ErrorCollector errors , String jsonSchemaResource , @ NonNull List <Path > files ) {
405
409
Configurations configs = new Configurations ();
406
410
boolean isValid = true ;
407
411
@@ -421,11 +425,11 @@ public static SqrlConfig fromFiles(ErrorCollector errors, String jsonSchemaResou
421
425
}
422
426
423
427
try {
424
- URL url = SqrlConfigCommons .class .getResource ("/default-package.json" );
425
- JSONConfiguration config = configs .fileBased (JSONConfiguration .class , url );
426
- combinedConfiguration .addConfiguration (config );
428
+ URL url = SqrlConfigCommons .class .getResource ("/default-package.json" );
429
+ JSONConfiguration config = configs .fileBased (JSONConfiguration .class , url );
430
+ combinedConfiguration .addConfiguration (config );
427
431
} catch (ConfigurationException e ) {
428
- throw errors .withConfig ("Error loading default configuration" ).handle (e );
432
+ throw errors .withConfig ("Error loading default configuration" ).handle (e );
429
433
}
430
434
431
435
String configFilename ;
0 commit comments