Skip to content

Commit

Permalink
new file creation and last modified output updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bosborn committed Mar 14, 2024
1 parent 7481de8 commit 1e777ba
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/mil/nga/geopackage/io/SQLExec.java
Original file line number Diff line number Diff line change
Expand Up @@ -480,18 +480,29 @@ public static void main(String[] args) throws Exception {

// Create the file if it does not exist
if (!GeoPackageManager.exists(sqliteFile)) {

sqliteFile = GeoPackageManager.create(sqliteFile, false);

boolean isGeoPackage = GeoPackageValidate
.hasGeoPackageExtension(sqliteFile);
System.out.println();
System.out.println("Created new file: " + sqliteFile.getPath());
System.out.print("Created new ");
if (isGeoPackage) {
System.out.print("GeoPackage");
} else {
System.out.print("database");
}
System.out.println(": " + sqliteFile.getPath());
}

GeoPackage database = GeoPackageManager.open(sqliteFile, false);
try {

printInfo(database, maxRows, maxColumnWidth, maxLinesPerRow);

File databaseFile = new File(database.getPath());
System.out.println("Last Modified: "
+ new Date(sqliteFile.lastModified()));
+ new Date(databaseFile.lastModified()));

if (dgiwg) {
dgiwg(database);
Expand Down

0 comments on commit 1e777ba

Please sign in to comment.