code: public static void readTiles(GeoPackage geoPackage, String tileTable,
  			File directory, String imageFormat, TileFormatType tileType,
  			boolean rawImage) throws IOException, SQLException {
  
  		// If no format, use the default
  		if (imageFormat == null) {
  			imageFormat = DEFAULT_IMAGE_FORMAT;
  		} else if (rawImage) {
  			throw new GeoPackageException(
  					"Image format is not used when raw images are used. Choose either image format or raw images.");
  		}
  
  		// Build the tile directory structure
  		TileDirectory tileDirectory = buildTileDirectory(directory);
  
  		LOGGER.log(Level.INFO,
  				"GeoPackage: "
  						+ geoPackage.getName()
  						+ ", Tile Table: "
  						+ tileTable
  						+ ", Input Directory: "
  						+ directory
  						+ (rawImage ? ", Raw Images" : ", Image Format: "
  								+ imageFormat) + ", Tiles Type: " + tileType
  						+ ", Zoom Range: " + tileDirectory.minZoom + " - "
  						+ tileDirectory.maxZoom);
  
  		int totalCount = 0;
  
  		switch (tileType) {
  
  		case GEOPACKAGE:
  			totalCount = readGeoPackageFormatTiles(geoPackage, tileTable,
  					imageFormat, rawImage, tileDirectory);
  			break;
  
  		case STANDARD:
  		case TMS:
  			totalCount = readFormatTiles(geoPackage, tileTable, imageFormat,
  					tileType, rawImage, tileDirectory);
  			break;
  
  		default:
  			throw new UnsupportedOperationException("Tile Type Not Supported: "
  					+ tileType);
  		}
  
  		LOGGER.log(Level.INFO, "Total Tiles: " + totalCount);
  
  	}
docs: Read the tiles in the directory into the GeoPackage file table
  
  @param geoPackage
  open GeoPackage
  @param tileTable
  tile table
  @param directory
  output directory
  @param imageFormat
  image format
  @param tileType
  tile type
  @param rawImage
  use raw image flag
  @throws IOException
  upon failure
  @throws SQLException
  upon failure