code: public static void readTiles(File geoPackageFile, String tileTable,
  			File directory, String imageFormat, TileFormatType tileType,
  			boolean rawImage) throws IOException, SQLException {
  
  		// If the GeoPackage does not exist create it
  		if (!geoPackageFile.exists()) {
  			if (!GeoPackageManager.create(geoPackageFile)) {
  				throw new GeoPackageException(
  						"Failed to create GeoPackage file: "
  								+ geoPackageFile.getAbsolutePath());
  			}
  		}
  
  		// Open the GeoPackage
  		GeoPackage geoPackage = GeoPackageManager.open(geoPackageFile);
  		try {
  			readTiles(geoPackage, tileTable, directory, imageFormat, tileType,
  					rawImage);
  		} finally {
  			geoPackage.close();
  		}
  	}
docs: Read the tiles in the directory into the GeoPackage file table
  
  @param geoPackageFile
  GeoPackage file
  @param tileTable
  tile table
  @param directory
  input directory
  @param imageFormat
  image format
  @param tileType
  tile type
  @param rawImage
  use raw image flag
  @throws IOException
  upon failure
  @throws SQLException
  upon failure