if (blankTilePath != null) {
File fh = new File(blankTilePath);
if (fh.exists() && fh.canRead() && fh.isFile()) {
long fileSize = fh.length();
blankTile = new ByteArrayResource(new byte[(int) fileSize]);
try {
loadBlankTile(blankTile, fh.toURI().toURL());
} catch (IOException e) {
e.printStackTrace();
}
if (fileSize == blankTile.getSize()) {
log.info("Loaded blank tile from " + blankTilePath);
} else {
log.error("Failed to load blank tile from " + blankTilePath);
}
return;
} else {
log.error("" + blankTilePath + " does not exist or is not readable.");
}
}
// Use the built-in one:
try {
URL url = GeoWebCacheDispatcher.class.getResource("blank.png");
blankTile = new ByteArrayResource();
loadBlankTile(blankTile, url);
int ret = (int) blankTile.getSize();
log.info("Read " + ret + " from blank PNG file (expected 425).");
} catch (IOException ioe) {
log.error(ioe.getMessage());