diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCache.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCache.java
index 3d4d29b8bd..819c43b3af 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCache.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCache.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -56,8 +55,8 @@ public abstract class ArcGISCompactCache {
* @param zoom Zoom levl
* @param row Row
* @param col Column
- * @return String containing complete path without file extension in the form of
- * .../Lzz/RrrrrCcccc with the number of c and r at least 4.
+ * @return String containing complete path without file extension in the form of .../Lzz/RrrrrCcccc with the number
+ * of c and r at least 4.
*/
protected String buildBundleFilePath(int zoom, int row, int col) {
StringBuilder bundlePath = new StringBuilder(pathToCacheRoot);
@@ -96,9 +95,8 @@ protected String buildBundleFilePath(int zoom, int row, int col) {
* @param filePath Path to file
* @param offset Read at offset
* @param length Read length bytes
- * @return ByteBuffer that contains read bytes and has byte order set to little endian. The
- * length of the byte buffer is multiple of 4, so getInt() and getLong() can be used even
- * when fewer bytes are read.
+ * @return ByteBuffer that contains read bytes and has byte order set to little endian. The length of the byte
+ * buffer is multiple of 4, so getInt() and getLong() can be used even when fewer bytes are read.
*/
protected ByteBuffer readFromLittleEndianFile(String filePath, long offset, int length) {
ByteBuffer result = null;
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV1.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV1.java
index 96836bedbe..63a17fbb28 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV1.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV1.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -21,13 +20,12 @@
/**
* Implementation of ArcGIS compact caches for ArcGIS 10.0 - 10.2
*
- *
The compact cache consists of bundle index files (*.bundlx) and bundle files (*.bundle), that
- * contain the actual image data. Every .bundlx file contains a 16 byte header and 16 byte footer.
- * Between header and footer is 128x128 matrix (16384 tiles) of 5 byte offsets. Every offset points
- * to a 4 byte word in the corresponding .bundle file which contains the size of the tile image
- * data. The actual image data starts at offset+4. If the size is zero there is no image data
- * available and the index entry is not used. If the map cache has more than 128 rows or columns it
- * is divided into several .bundlx and .bundle files.
+ *
The compact cache consists of bundle index files (*.bundlx) and bundle files (*.bundle), that contain the actual
+ * image data. Every .bundlx file contains a 16 byte header and 16 byte footer. Between header and footer is 128x128
+ * matrix (16384 tiles) of 5 byte offsets. Every offset points to a 4 byte word in the corresponding .bundle file which
+ * contains the size of the tile image data. The actual image data starts at offset+4. If the size is zero there is no
+ * image data available and the index entry is not used. If the map cache has more than 128 rows or columns it is
+ * divided into several .bundlx and .bundle files.
*
* @author Bjoern Saxe
*/
@@ -39,12 +37,11 @@ public class ArcGISCompactCacheV1 extends ArcGISCompactCache {
/**
* Constructs new ArcGIS 10.0-10.2 compact cache.
*
- * @param pathToCacheRoot Path to compact cache directory (usually ".../_alllayers/"). Path must
- * contain directories for zoom levels (named "Lxx").
+ * @param pathToCacheRoot Path to compact cache directory (usually ".../_alllayers/"). Path must contain directories
+ * for zoom levels (named "Lxx").
*/
public ArcGISCompactCacheV1(String pathToCacheRoot) {
- if (pathToCacheRoot.endsWith("" + File.separatorChar))
- this.pathToCacheRoot = pathToCacheRoot;
+ if (pathToCacheRoot.endsWith("" + File.separatorChar)) this.pathToCacheRoot = pathToCacheRoot;
else this.pathToCacheRoot = pathToCacheRoot + File.separatorChar;
indexCache = new BundlxCache(10000);
@@ -60,16 +57,14 @@ public Resource getBundleFileResource(int zoom, int row, int col) {
Resource res = null;
if ((entry = indexCache.get(key)) != null) {
- if (entry.size > 0)
- res = new BundleFileResource(entry.pathToBundleFile, entry.offset, entry.size);
+ if (entry.size > 0) res = new BundleFileResource(entry.pathToBundleFile, entry.offset, entry.size);
} else {
String basePath = buildBundleFilePath(zoom, row, col);
String pathToBundlxFile = basePath + BUNDLX_EXT;
String pathToBundleFile = basePath + BUNDLE_EXT;
- if (!(new File(pathToBundleFile)).exists() || !(new File(pathToBundlxFile)).exists())
- return null;
+ if (!(new File(pathToBundleFile)).exists() || !(new File(pathToBundlxFile)).exists()) return null;
long tileOffset = readTileStartOffset(pathToBundlxFile, row, col);
int tileSize = readTileSize(pathToBundleFile, tileOffset);
@@ -89,8 +84,7 @@ public Resource getBundleFileResource(int zoom, int row, int col) {
private long readTileStartOffset(String bundlxFile, int row, int col) {
int index = BUNDLX_MAXIDX * (col % BUNDLX_MAXIDX) + (row % BUNDLX_MAXIDX);
- ByteBuffer idxBytes =
- readFromLittleEndianFile(bundlxFile, (index * 5) + COMPACT_CACHE_HEADER_LENGTH, 5);
+ ByteBuffer idxBytes = readFromLittleEndianFile(bundlxFile, (index * 5) + COMPACT_CACHE_HEADER_LENGTH, 5);
return idxBytes.getLong();
}
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV2.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV2.java
index afaa438305..f8bdae82cf 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV2.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV2.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -22,14 +21,12 @@
/**
* Implementation of ArcGIS compact caches for ArcGIS 10.3
*
- *
The compact cache consists of bundle files (*.bundle), that contain an index and the actual
- * image data. Every .bundle file starts with a 64 byte header. After the header 128x128 matrix
- * (16384 tiles) of 8 byte words. The first 5 bytes of every word is the offset that points to the
- * tile image data inside the same .bundle file. The next 3 bytes is the size of the image data. The
- * size of the image data is repeated at offset-4 in 4 byte word. Unused index entries use
- * 04|00|00|00|00|00|00|00. If the size is zero than there is no image data available and the index
- * entry is. If the map cache has more than 128 rows or columns it is divided into several .bundle
- * files.
+ *
The compact cache consists of bundle files (*.bundle), that contain an index and the actual image data. Every
+ * .bundle file starts with a 64 byte header. After the header 128x128 matrix (16384 tiles) of 8 byte words. The first 5
+ * bytes of every word is the offset that points to the tile image data inside the same .bundle file. The next 3 bytes
+ * is the size of the image data. The size of the image data is repeated at offset-4 in 4 byte word. Unused index
+ * entries use 04|00|00|00|00|00|00|00. If the size is zero than there is no image data available and the index entry
+ * is. If the map cache has more than 128 rows or columns it is divided into several .bundle files.
*
* @author Bjoern Saxe
*/
@@ -41,12 +38,11 @@ public class ArcGISCompactCacheV2 extends ArcGISCompactCache {
/**
* Constructs new ArcGIS 10.3 compact cache.
*
- * @param pathToCacheRoot Path to compact cache directory (usually ".../_alllayers/"). Path must
- * contain directories for zoom levels (named "Lxx").
+ * @param pathToCacheRoot Path to compact cache directory (usually ".../_alllayers/"). Path must contain directories
+ * for zoom levels (named "Lxx").
*/
public ArcGISCompactCacheV2(String pathToCacheRoot) {
- if (pathToCacheRoot.endsWith("" + File.separatorChar))
- this.pathToCacheRoot = pathToCacheRoot;
+ if (pathToCacheRoot.endsWith("" + File.separatorChar)) this.pathToCacheRoot = pathToCacheRoot;
else this.pathToCacheRoot = pathToCacheRoot + File.separatorChar;
indexCache = new BundlxCache(10000);
@@ -62,8 +58,7 @@ public Resource getBundleFileResource(int zoom, int row, int col) {
Resource res = null;
if ((entry = indexCache.get(key)) != null) {
- if (entry.size > 0)
- res = new BundleFileResource(entry.pathToBundleFile, entry.offset, entry.size);
+ if (entry.size > 0) res = new BundleFileResource(entry.pathToBundleFile, entry.offset, entry.size);
} else {
String basePath = buildBundleFilePath(zoom, row, col);
@@ -73,8 +68,7 @@ public Resource getBundleFileResource(int zoom, int row, int col) {
entry = createCacheEntry(pathToBundleFile, row, col);
- if (entry.size > 0)
- res = new BundleFileResource(pathToBundleFile, entry.offset, entry.size);
+ if (entry.size > 0) res = new BundleFileResource(pathToBundleFile, entry.offset, entry.size);
indexCache.put(key, entry);
}
@@ -87,8 +81,7 @@ private BundlxCache.CacheEntry createCacheEntry(String bundleFile, int row, int
int index = BUNDLX_MAXIDX * (row % BUNDLX_MAXIDX) + (col % BUNDLX_MAXIDX);
// to save one addtional read, we read all 8 bytes in one read
- ByteBuffer offsetAndSize =
- readFromLittleEndianFile(bundleFile, (index * 8) + COMPACT_CACHE_HEADER_LENGTH, 8);
+ ByteBuffer offsetAndSize = readFromLittleEndianFile(bundleFile, (index * 8) + COMPACT_CACHE_HEADER_LENGTH, 8);
byte[] offsetBytes = new byte[8];
byte[] sizeBytes = new byte[4];
@@ -96,7 +89,8 @@ private BundlxCache.CacheEntry createCacheEntry(String bundleFile, int row, int
offsetAndSize.get(offsetBytes, 0, 5);
offsetAndSize.get(sizeBytes, 0, 3);
- long tileOffset = ByteBuffer.wrap(offsetBytes).order(ByteOrder.LITTLE_ENDIAN).getLong();
+ long tileOffset =
+ ByteBuffer.wrap(offsetBytes).order(ByteOrder.LITTLE_ENDIAN).getLong();
int tileSize = ByteBuffer.wrap(sizeBytes).order(ByteOrder.LITTLE_ENDIAN).getInt();
return new BundlxCache.CacheEntry(bundleFile, tileOffset, tileSize);
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundleFileResource.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundleFileResource.java
index d61391e9da..8cd34bdfa5 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundleFileResource.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundleFileResource.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -57,7 +56,8 @@ public long transferTo(WritableByteChannel target) throws IOException {
FileChannel in = fin.getChannel()) {
final long size = tileSize;
long written = 0;
- while ((written += in.transferTo(tileOffset + written, size, target)) < size) ;
+ while ((written += in.transferTo(tileOffset + written, size, target)) < size)
+ ;
return size;
}
}
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundlxCache.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundlxCache.java
index ff71e4281e..909beb6662 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundlxCache.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundlxCache.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -20,8 +19,8 @@
/**
* Cache that stores data from .bundlx files.
*
- *
Zoom, row, and column of the tile are used as key. Entries contain the path to the .bundle
- * file, the size of the tile and the offset of the image data inside the .bundle file.
+ *
Zoom, row, and column of the tile are used as key. Entries contain the path to the .bundle file, the size of the
+ * tile and the offset of the image data inside the .bundle file.
*
* @author Bjoern Saxe
*/
@@ -79,8 +78,8 @@ public CacheEntry(String pathToBundleFile, long offset, int size) {
/**
* Cache that stores the path ot the .
*
- * @param maxSize Maximum size of cache. If the size of the cache equals maxSize, adding a new
- * entry will remove the least recently used entry from the cache.
+ * @param maxSize Maximum size of cache. If the size of the cache equals maxSize, adding a new entry will remove the
+ * least recently used entry from the cache.
*/
public BundlxCache(int maxSize) {
indexCache = CacheBuilder.newBuilder().maximumSize(maxSize).build();
@@ -90,8 +89,7 @@ public BundlxCache(int maxSize) {
* Get the entry for a key from the cache.
*
* @param key Key.
- * @return Returns the entry. Returns null if the key has a null value or if the key has no
- * entry.
+ * @return Returns the entry. Returns null if the key has a null value or if the key has no entry.
*/
public synchronized CacheEntry get(CacheKey key) {
return indexCache.getIfPresent(key);
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfo.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfo.java
index 1901a60da9..bfe9ec921a 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfo.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfoPersister.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfoPersister.java
index ebf1151e84..360f162f0c 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfoPersister.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfoPersister.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -86,8 +85,7 @@ public BoundingBox parseLayerBounds(final Reader layerBoundsFile) {
EnvelopeN envN = (EnvelopeN) getConfiguredXStream().fromXML(layerBoundsFile);
- BoundingBox bbox =
- new BoundingBox(envN.getXmin(), envN.getYmin(), envN.getXmax(), envN.getYmax());
+ BoundingBox bbox = new BoundingBox(envN.getXmin(), envN.getYmin(), envN.getXmax(), envN.getYmax());
return bbox;
}
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheStorageInfo.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheStorageInfo.java
index bc3c967d18..34f76b9df9 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheStorageInfo.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheStorageInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -17,9 +16,8 @@
/**
* Represents a {@code CacheStorageInfo} element in an ArcGIS tile cache config file.
*
- *
This element exists from ArcGIS 10.0 onwards, and defines whether the cache is in "exploded"
- * or "compact" format. As the "compact" format is not documented by ESRI, we only support the
- * "exploded" format.
+ *
This element exists from ArcGIS 10.0 onwards, and defines whether the cache is in "exploded" or "compact" format.
+ * As the "compact" format is not documented by ESRI, we only support the "exploded" format.
*
*
XML representation:
*
@@ -51,10 +49,7 @@ private Object readResolve() {
return this;
}
- /**
- * The storage format defined in the config file, defaults to {@link #EXPLODED_FORMAT_CODE
- * exploded format}
- */
+ /** The storage format defined in the config file, defaults to {@link #EXPLODED_FORMAT_CODE exploded format} */
public String getStorageFormat() {
return storageFormat;
}
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/EnvelopeN.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/EnvelopeN.java
index 8157a85478..07c609c862 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/EnvelopeN.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/EnvelopeN.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/LODInfo.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/LODInfo.java
index 74730181b4..f19cf84727 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/LODInfo.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/LODInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/SpatialReference.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/SpatialReference.java
index cc7883f464..772318211e 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/SpatialReference.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/SpatialReference.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileCacheInfo.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileCacheInfo.java
index 175dd46d02..97acfd95e6 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileCacheInfo.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileCacheInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileImageInfo.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileImageInfo.java
index 65e659f17e..a151f52960 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileImageInfo.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileImageInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileOrigin.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileOrigin.java
index 0d602bf632..0a376fabc7 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileOrigin.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/TileOrigin.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -17,10 +16,9 @@
/**
* Represents a {@code TileOrigin} element in an ArcGIS cache config file.
*
- *
The upper left point on the tiling grid. The tiling origin is usually not the point where
- * tiles begin to be created; that only happens in the full extent of the map. Usually the tiling
- * origin is far outside the map to ensure that the map area will be covered and that other caches
- * with the same tiling origin can overlay your cache.
+ *
The upper left point on the tiling grid. The tiling origin is usually not the point where tiles begin to be
+ * created; that only happens in the full extent of the map. Usually the tiling origin is far outside the map to ensure
+ * that the map area will be covered and that other caches with the same tiling origin can overlay your cache.
*
*
XML Structure:
*
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISCacheGridsetConfiguration.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISCacheGridsetConfiguration.java
index 78bf00c8a9..4297494b12 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISCacheGridsetConfiguration.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISCacheGridsetConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISCacheLayer.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISCacheLayer.java
index 1caeb04b55..c518ddb3e0 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISCacheLayer.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISCacheLayer.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -72,15 +71,13 @@ public class ArcGISCacheLayer extends AbstractTileLayer {
private File tilingScheme;
/**
- * Optional, location of the actual tiles folder. If not provided defaults to the {@code
- * _alllayers} directory at the same location than the {@link #getTilingScheme() conf.xml}
- * tiling scheme.
+ * Optional, location of the actual tiles folder. If not provided defaults to the {@code _alllayers} directory at
+ * the same location than the {@link #getTilingScheme() conf.xml} tiling scheme.
*/
private File tileCachePath;
/**
- * Optional, configure whether or not the z-values should be hex-encoded or not. If not provided
- * defaults to false
+ * Optional, configure whether or not the z-values should be hex-encoded or not. If not provided defaults to false
*/
private Boolean hexZoom;
@@ -122,18 +119,17 @@ public void setTilingScheme(final File tilingScheme) {
}
/**
- * Returns the location of the actual tiles folder, or {@code null} if not provided, in which
- * case defaults internally to the {@code _alllayers} directory at the same location than the
- * {@link #getTilingScheme() conf.xml} tiling scheme.
+ * Returns the location of the actual tiles folder, or {@code null} if not provided, in which case defaults
+ * internally to the {@code _alllayers} directory at the same location than the {@link #getTilingScheme() conf.xml}
+ * tiling scheme.
*/
public File getTileCachePath() {
return tileCachePath;
}
/**
- * Options, location of the actual tiles folder. If not provided defaults to the {@code
- * _alllayers} directory at the same location than the {@link #getTilingScheme() conf.xml}
- * tiling scheme.
+ * Options, location of the actual tiles folder. If not provided defaults to the {@code _alllayers} directory at the
+ * same location than the {@link #getTilingScheme() conf.xml} tiling scheme.
*/
public void setTileCachePath(File tileCachePath) {
this.tileCachePath = tileCachePath;
@@ -148,8 +144,7 @@ public void setHexZoom(boolean hexZoom) {
}
/**
- * @return {@code true} if success. Note this method's return type should be void. It's not
- * checked anywhere
+ * @return {@code true} if success. Note this method's return type should be void. It's not checked anywhere
* @see org.geowebcache.layer.TileLayer#initialize(org.geowebcache.grid.GridSetBroker)
*/
@Override
@@ -158,20 +153,16 @@ protected boolean initializeInternal(GridSetBroker gridSetBroker) {
this.enabled = true;
}
if (this.tilingScheme == null) {
- throw new IllegalStateException(
- "tilingScheme has not been set. It should point to the ArcGIS "
- + "cache tiling scheme file for this layer (conf.xml)");
+ throw new IllegalStateException("tilingScheme has not been set. It should point to the ArcGIS "
+ + "cache tiling scheme file for this layer (conf.xml)");
}
if (tileCachePath != null) {
- if (!tileCachePath.exists()
- || !tileCachePath.isDirectory()
- || !tileCachePath.canRead()) {
- throw new IllegalStateException(
- "tileCachePath property for layer '"
- + getName()
- + "' is set to '"
- + tileCachePath
- + "' but the directory either does not exist or is not readable");
+ if (!tileCachePath.exists() || !tileCachePath.isDirectory() || !tileCachePath.canRead()) {
+ throw new IllegalStateException("tileCachePath property for layer '"
+ + getName()
+ + "' is set to '"
+ + tileCachePath
+ + "' but the directory either does not exist or is not readable");
}
}
if (this.hexZoom == null) {
@@ -182,8 +173,7 @@ protected boolean initializeInternal(GridSetBroker gridSetBroker) {
cacheInfo = tilingSchemeLoader.load(new FileReader(tilingScheme));
File layerBoundsFile = new File(tilingScheme.getParentFile(), "conf.cdi");
if (!layerBoundsFile.exists()) {
- throw new RuntimeException(
- "Layer bounds file not found: " + layerBoundsFile.getAbsolutePath());
+ throw new RuntimeException("Layer bounds file not found: " + layerBoundsFile.getAbsolutePath());
}
log.info("Parsing layer bounds for " + getName());
this.layerBounds = tilingSchemeLoader.parseLayerBounds(new FileReader(layerBoundsFile));
@@ -204,14 +194,12 @@ protected boolean initializeInternal(GridSetBroker gridSetBroker) {
}
}
} catch (FileNotFoundException e) {
- throw new IllegalStateException(
- "Tiling scheme file not found: " + tilingScheme.getAbsolutePath());
+ throw new IllegalStateException("Tiling scheme file not found: " + tilingScheme.getAbsolutePath());
}
- log.info(
- "Configuring layer "
- + getName()
- + " out of the ArcGIS tiling scheme "
- + tilingScheme.getAbsolutePath());
+ log.info("Configuring layer "
+ + getName()
+ + " out of the ArcGIS tiling scheme "
+ + tilingScheme.getAbsolutePath());
super.subSets = createGridSubsets(gridSetBroker);
super.formats = loadMimeTypes();
@@ -251,8 +239,7 @@ private HashMap createGridSubsets(final GridSetBroker gridSe
Integer zoomStart = lodInfos.get(0).getLevelID();
Integer zoomStop = lodInfos.get(lodInfos.size() - 1).getLevelID();
- GridSubset subSet =
- GridSubsetFactory.createGridSubSet(gridSet, this.layerBounds, zoomStart, zoomStop);
+ GridSubset subSet = GridSubsetFactory.createGridSubSet(gridSet, this.layerBounds, zoomStart, zoomStop);
HashMap subsets = new HashMap<>();
subsets.put(gridSet.getName(), subSet);
@@ -453,27 +440,19 @@ private Resource readFile(File fh) {
return res;
}
- /**
- * @see org.geowebcache.layer.TileLayer#getNoncachedTile(org.geowebcache.conveyor.ConveyorTile)
- */
+ /** @see org.geowebcache.layer.TileLayer#getNoncachedTile(org.geowebcache.conveyor.ConveyorTile) */
@Override
public ConveyorTile getNoncachedTile(ConveyorTile tile) throws GeoWebCacheException {
throw new UnsupportedOperationException();
}
- /**
- * @see org.geowebcache.layer.TileLayer#seedTile(org.geowebcache.conveyor.ConveyorTile, boolean)
- */
+ /** @see org.geowebcache.layer.TileLayer#seedTile(org.geowebcache.conveyor.ConveyorTile, boolean) */
@Override
- public void seedTile(ConveyorTile tile, boolean tryCache)
- throws GeoWebCacheException, IOException {
+ public void seedTile(ConveyorTile tile, boolean tryCache) throws GeoWebCacheException, IOException {
throw new UnsupportedOperationException();
}
- /**
- * @see
- * org.geowebcache.layer.TileLayer#doNonMetatilingRequest(org.geowebcache.conveyor.ConveyorTile)
- */
+ /** @see org.geowebcache.layer.TileLayer#doNonMetatilingRequest(org.geowebcache.conveyor.ConveyorTile) */
@Override
public ConveyorTile doNonMetatilingRequest(ConveyorTile tile) throws GeoWebCacheException {
throw new UnsupportedOperationException();
@@ -485,11 +464,7 @@ public String getStyles() {
return null;
}
- /**
- * @see
- * org.geowebcache.layer.TileLayer#setExpirationHeader(javax.servlet.http.HttpServletResponse,
- * int)
- */
+ /** @see org.geowebcache.layer.TileLayer#setExpirationHeader(javax.servlet.http.HttpServletResponse, int) */
@Override
public void setExpirationHeader(HttpServletResponse response, int zoomLevel) {
/*
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISLayerXMLConfigurationProvider.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISLayerXMLConfigurationProvider.java
index 8d47bf3122..bf47cdf67a 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISLayerXMLConfigurationProvider.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/ArcGISLayerXMLConfigurationProvider.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -19,8 +18,8 @@
import org.geowebcache.config.XMLConfigurationProvider;
/**
- * Implementation of the {@link XMLConfigurationProvider} extension point to extend the {@code
- * geowebcache.xml} configuration file with {@code arcgisLayer} layers.
+ * Implementation of the {@link XMLConfigurationProvider} extension point to extend the {@code geowebcache.xml}
+ * configuration file with {@code arcgisLayer} layers.
*
* @author Gabriel Roldan
*/
diff --git a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/GridSetBuilder.java b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/GridSetBuilder.java
index 7f3a319db0..db83c042c2 100644
--- a/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/GridSetBuilder.java
+++ b/geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/layer/GridSetBuilder.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -34,8 +33,7 @@
class GridSetBuilder {
/** Creates a {@link GridSet} out of a ArcGIS tiling scheme */
- public GridSet buildGridset(
- final String layerName, final CacheInfo info, final BoundingBox layerBounds) {
+ public GridSet buildGridset(final String layerName, final CacheInfo info, final BoundingBox layerBounds) {
Assert.notNull(layerName, "Layer name must be non null");
Assert.notNull(info, "Layer name must be non null");
@@ -106,20 +104,19 @@ public GridSet buildGridset(
}
String gridsetName = srs.toString() + "_" + layerName;
- GridSet layerGridset =
- GridSetFactory.createGridSet(
- gridsetName,
- srs,
- gridSetExtent,
- alignTopLeft,
- resolutions,
- scaleDenominators,
- metersPerUnit,
- pixelSize,
- scaleNames,
- tileWidth,
- tileHeight,
- yCoordinateFirst);
+ GridSet layerGridset = GridSetFactory.createGridSet(
+ gridsetName,
+ srs,
+ gridSetExtent,
+ alignTopLeft,
+ resolutions,
+ scaleDenominators,
+ metersPerUnit,
+ pixelSize,
+ scaleNames,
+ tileWidth,
+ tileHeight,
+ yCoordinateFirst);
return layerGridset;
}
diff --git a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheTest.java b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheTest.java
index 603925fb7f..42cebc55b6 100755
--- a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheTest.java
+++ b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheTest.java
@@ -13,42 +13,26 @@
*
*
10.0 - 10.2 cache
*
- *
zoom level | min row | max row | min col | max col | | | | 5 | 10 | 13 | 4 | 10 | | | | 6 | 22
- * | 28 | 10 | 21
+ *
zoom level | min row | max row | min col | max col | | | | 5 | 10 | 13 | 4 | 10 | | | | 6 | 22 | 28 | 10 | 21
*
- *
- image format is JPEG - tile size for (5,12,7) is 6342 bytes - tile size for (6,25,17) is
- * 6308 bytes
+ *
- image format is JPEG - tile size for (5,12,7) is 6342 bytes - tile size for (6,25,17) is 6308 bytes
*
*
10.3 cache
*
- *
zoom level | min row | max row | min col | max col | | | | 4 | 5 | 6 | 2 | 5 | | | | 5 | 10 |
- * 13 | 4 | 10
+ *
zoom level | min row | max row | min col | max col | | | | 4 | 5 | 6 | 2 | 5 | | | | 5 | 10 | 13 | 4 | 10
*
- *
- image format is JPEG - tile size for (4,5,4) is 7288 bytes - tile size for (5,11,5) is 6055
- * bytes
+ *
- image format is JPEG - tile size for (4,5,4) is 7288 bytes - tile size for (5,11,5) is 6055 bytes
*
*
Not verifiable with this unit test because the supplied test cache is too small:
*
- *
- zoom levels can contain more than one .bundle/.bundlx file - row and column numbers have at
- * least 4 digits in bundle file name, but with really big caches row and column numbers can have
- * more than 4 digits
+ *
- zoom levels can contain more than one .bundle/.bundlx file - row and column numbers have at least 4 digits in
+ * bundle file name, but with really big caches row and column numbers can have more than 4 digits
*
* @author Bjoern Saxe
*/
public class ArcGISCompactCacheTest {
private static final byte[] JFIFHeader = {
- (byte) 0xFF,
- (byte) 0xD8,
- (byte) 0xFF,
- (byte) 0xE0,
- 0x00,
- 0x10,
- 0x4A,
- 0x46,
- 0x49,
- 0x46,
- 0x00,
- 0x01
+ (byte) 0xFF, (byte) 0xD8, (byte) 0xFF, (byte) 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01
};
@Test
diff --git a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/config/CacheInfoPersisterTest.java b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/config/CacheInfoPersisterTest.java
index 171ee49101..a0b8918400 100644
--- a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/config/CacheInfoPersisterTest.java
+++ b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/config/CacheInfoPersisterTest.java
@@ -13,23 +13,22 @@ public class CacheInfoPersisterTest {
@Test
public void testLoadSpatialReference() {
- String spatialRef =
- "" //
- + " PROJCS["NZGD_2000_New_Zealand_Transverse_Mercator",GEOGCS["GCS_NZGD_2000",DATUM["D_NZGD_2000",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",1600000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",173.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0],AUTHORITY["EPSG",2193]] " //
- + " -4020900 " //
- + " 1900 " //
- + " 450445547.3910538 " //
- + " 0.5 " //
- + " 1 " //
- + " -100000 " //
- + " 10000 " //
- + " 0.0037383177570093459 " //
- + " 2 " //
- + " 2 " //
- + " true " //
- + " 2193 " //
- + " 2193 " //
- + " ";
+ String spatialRef = "" //
+ + " PROJCS["NZGD_2000_New_Zealand_Transverse_Mercator",GEOGCS["GCS_NZGD_2000",DATUM["D_NZGD_2000",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",1600000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",173.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0],AUTHORITY["EPSG",2193]] " //
+ + " -4020900 " //
+ + " 1900 " //
+ + " 450445547.3910538 " //
+ + " 0.5 " //
+ + " 1 " //
+ + " -100000 " //
+ + " 10000 " //
+ + " 0.0037383177570093459 " //
+ + " 2 " //
+ + " 2 " //
+ + " true " //
+ + " 2193 " //
+ + " 2193 " //
+ + " ";
CacheInfoPersister persister = new CacheInfoPersister();
XStream xs = persister.getConfiguredXStream();
@@ -55,11 +54,10 @@ public void testLoadSpatialReference() {
@Test
public void testLoadTileOrigin() {
- String tileOrigin =
- "" //
- + " -4020900 " //
- + " 19998100 " //
- + " ";
+ String tileOrigin = "" //
+ + " -4020900 " //
+ + " 19998100 " //
+ + " ";
CacheInfoPersister persister = new CacheInfoPersister();
XStream xs = persister.getConfiguredXStream();
TileOrigin to = (TileOrigin) xs.fromXML(new StringReader(tileOrigin));
@@ -70,23 +68,22 @@ public void testLoadTileOrigin() {
@Test
public void testLoadTileCacheInfo() {
- String tileCacheInfo =
- "" //
- + " " //
- + " " //
- + " " //
- + " -4020900 " //
- + " 19998100 " //
- + " " //
- + " 512 " //
- + " 512 " //
- + " 96 " //
- + " 96 " //
- + " " //
- + " " //
- + " " //
- + " " //
- + " ";
+ String tileCacheInfo = "" //
+ + " " //
+ + " " //
+ + " " //
+ + " -4020900 " //
+ + " 19998100 " //
+ + " " //
+ + " 512 " //
+ + " 512 " //
+ + " 96 " //
+ + " 96 " //
+ + " " //
+ + " " //
+ + " " //
+ + " " //
+ + " ";
CacheInfoPersister persister = new CacheInfoPersister();
XStream xs = persister.getConfiguredXStream();
@@ -104,12 +101,11 @@ public void testLoadTileCacheInfo() {
@Test
public void testLoadLODInfo() {
- String lodInfo =
- "" //
- + " 10 " //
- + " 6000000 " //
- + " 1587.5031750063501 " //
- + " ";
+ String lodInfo = "" //
+ + " 10 " //
+ + " 6000000 " //
+ + " 1587.5031750063501 " //
+ + " ";
CacheInfoPersister persister = new CacheInfoPersister();
XStream xs = persister.getConfiguredXStream();
@@ -122,14 +118,13 @@ public void testLoadLODInfo() {
@Test
public void testLoadTileImageInfo() {
- String tileImageInfo =
- "" //
- + " JPEG " //
- + " 80 " //
- + " true " //
- + " 1 " //
- + " 0 " //
- + " ";
+ String tileImageInfo = "" //
+ + " JPEG " //
+ + " 80 " //
+ + " true " //
+ + " 1 " //
+ + " 0 " //
+ + " ";
CacheInfoPersister persister = new CacheInfoPersister();
XStream xs = persister.getConfiguredXStream();
@@ -144,11 +139,10 @@ public void testLoadTileImageInfo() {
@Test
public void testLoadCacheStorageInfo() {
- String cacheStorageInfo =
- "" //
- + " esriMapCacheStorageModeExploded " //
- + " 10 " //
- + " ";
+ String cacheStorageInfo = "" //
+ + " esriMapCacheStorageModeExploded " //
+ + " 10 " //
+ + " ";
CacheInfoPersister persister = new CacheInfoPersister();
XStream xs = persister.getConfiguredXStream();
diff --git a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/ArcGISCacheLayerTest.java b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/ArcGISCacheLayerTest.java
index 25ebd8ee4e..714335deb4 100644
--- a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/ArcGISCacheLayerTest.java
+++ b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/ArcGISCacheLayerTest.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2022
*/
@@ -31,7 +30,8 @@
import org.springframework.context.ApplicationContext;
public class ArcGISCacheLayerTest {
- @Rule public TemporaryFolder temp = new TemporaryFolder();
+ @Rule
+ public TemporaryFolder temp = new TemporaryFolder();
@Test
public void testArcGISCacheLayerInitialization() throws Exception {
diff --git a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/ArcGISLayerXMLConfigurationProviderTest.java b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/ArcGISLayerXMLConfigurationProviderTest.java
index eca0488fed..0e67dd86ca 100644
--- a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/ArcGISLayerXMLConfigurationProviderTest.java
+++ b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/ArcGISLayerXMLConfigurationProviderTest.java
@@ -13,15 +13,12 @@ public class ArcGISLayerXMLConfigurationProviderTest {
public void testGetConfiguredXStream() {
final Map aliases = new HashMap<>();
- XStream xs =
- new ArcGISLayerXMLConfigurationProvider()
- .getConfiguredXStream(
- new GeoWebCacheXStream() {
- @Override
- public void alias(String alias, Class c) {
- aliases.put(alias, c);
- }
- });
+ XStream xs = new ArcGISLayerXMLConfigurationProvider().getConfiguredXStream(new GeoWebCacheXStream() {
+ @Override
+ public void alias(String alias, Class c) {
+ aliases.put(alias, c);
+ }
+ });
Assert.assertNotNull(xs);
Assert.assertEquals(ArcGISCacheLayer.class, aliases.get("arcgisLayer"));
diff --git a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/XMLConfigurationLayerConformanceWithArcGisLayersTest.java b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/XMLConfigurationLayerConformanceWithArcGisLayersTest.java
index 963c67b0bf..5117e53518 100644
--- a/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/XMLConfigurationLayerConformanceWithArcGisLayersTest.java
+++ b/geowebcache/arcgiscache/src/test/java/org/geowebcache/arcgis/layer/XMLConfigurationLayerConformanceWithArcGisLayersTest.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -44,8 +43,7 @@
import org.hamcrest.Matchers;
import org.junit.Test;
-public class XMLConfigurationLayerConformanceWithArcGisLayersTest
- extends XMLConfigurationLayerConformanceTest {
+public class XMLConfigurationLayerConformanceWithArcGisLayersTest extends XMLConfigurationLayerConformanceTest {
@Override
public void setUpTestUnit() throws Exception {
@@ -105,15 +103,13 @@ public ConveyorTile getNoncachedTile(ConveyorTile tile) throws GeoWebCacheExcept
}
@Override
- public void seedTile(ConveyorTile tile, boolean tryCache)
- throws GeoWebCacheException, IOException {
+ public void seedTile(ConveyorTile tile, boolean tryCache) throws GeoWebCacheException, IOException {
// TODO Auto-generated method stub
}
@Override
- public ConveyorTile doNonMetatilingRequest(ConveyorTile tile)
- throws GeoWebCacheException {
+ public ConveyorTile doNonMetatilingRequest(ConveyorTile tile) throws GeoWebCacheException {
// TODO Auto-generated method stub
return null;
}
@@ -123,17 +119,12 @@ public ConveyorTile doNonMetatilingRequest(ConveyorTile tile)
@Override
protected Matcher infoEquals(TileLayer expected) {
return new CustomMatcher<>(
- "ArcGISCacheLayer matching "
- + expected.getName()
- + " with "
- + expected.getBackendTimeout()) {
+ "ArcGISCacheLayer matching " + expected.getName() + " with " + expected.getBackendTimeout()) {
@Override
public boolean matches(Object item) {
return item instanceof ArcGISCacheLayer
- && ((ArcGISCacheLayer) item)
- .getBackendTimeout()
- .equals(expected.getBackendTimeout());
+ && ((ArcGISCacheLayer) item).getBackendTimeout().equals(expected.getBackendTimeout());
}
};
}
@@ -166,22 +157,16 @@ protected void makeConfigFile() throws Exception {
configDir = temp.getRoot();
configFile = temp.newFile("geowebcache.xml");
- URL source =
- XMLConfigurationLayerConformanceWithArcGisLayersTest.class.getResource(
- "geowebcache.xml");
+ URL source = XMLConfigurationLayerConformanceWithArcGisLayersTest.class.getResource("geowebcache.xml");
try (Stream lines = Files.lines(Paths.get(source.toURI()))) {
- List replaced =
- lines.map(
- line -> {
- String tilingSchemePath =
- resourceAsFile("/compactcache/Conf.xml")
- .getAbsolutePath();
- // no need to use replaceAll and involve regex
- // replacement rules
- return line.replace(
- "TILING_SCHEME_PATH", tilingSchemePath);
- })
- .collect(Collectors.toList());
+ List replaced = lines.map(line -> {
+ String tilingSchemePath =
+ resourceAsFile("/compactcache/Conf.xml").getAbsolutePath();
+ // no need to use replaceAll and involve regex
+ // replacement rules
+ return line.replace("TILING_SCHEME_PATH", tilingSchemePath);
+ })
+ .collect(Collectors.toList());
Files.write(configFile.toPath(), replaced);
}
}
@@ -190,11 +175,8 @@ protected void makeConfigFile() throws Exception {
@Override
protected TileLayerConfiguration getConfig(MockWepAppContextRule extensions) throws Exception {
extensions.addBean(
- "ArcGISLayerConfigProvider",
- new ArcGISLayerXMLConfigurationProvider(),
- XMLConfigurationProvider.class);
- ArcGISCacheGridsetConfiguration arcGISCacheGridsetConfiguration =
- new ArcGISCacheGridsetConfiguration();
+ "ArcGISLayerConfigProvider", new ArcGISLayerXMLConfigurationProvider(), XMLConfigurationProvider.class);
+ ArcGISCacheGridsetConfiguration arcGISCacheGridsetConfiguration = new ArcGISCacheGridsetConfiguration();
extensions.addBean(
"ArcGISLayerGridSetConfiguration",
arcGISCacheGridsetConfiguration,
@@ -210,10 +192,7 @@ public void testGetExistingHasGridset() throws Exception {
Optional retrieved = getInfo(config, getExistingInfo());
assertThat(
retrieved,
- isPresent(
- hasProperty(
- "gridSubsets",
- Matchers.containsInAnyOrder("EPSG:3857_testExisting"))));
+ isPresent(hasProperty("gridSubsets", Matchers.containsInAnyOrder("EPSG:3857_testExisting"))));
}
@Test
diff --git a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStore.java b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStore.java
index a3a08f8ec4..14d105cbab 100644
--- a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStore.java
+++ b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStore.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -69,8 +68,7 @@ public class AzureBlobStore implements BlobStore {
private volatile boolean shutDown = false;
- public AzureBlobStore(
- AzureBlobStoreData configuration, TileLayerDispatcher layers, LockProvider lockProvider)
+ public AzureBlobStore(AzureBlobStoreData configuration, TileLayerDispatcher layers, LockProvider lockProvider)
throws StorageException {
this.client = new AzureClient(configuration);
@@ -81,16 +79,13 @@ public AzureBlobStore(
boolean emptyFolder = !client.prefixExists(prefix);
boolean existingMetadata = client.blobExists(keyBuilder.storeMetadata());
- CompositeBlobStore.checkSuitability(
- configuration.getLocation(), existingMetadata, emptyFolder);
+ CompositeBlobStore.checkSuitability(configuration.getLocation(), existingMetadata, emptyFolder);
// Just a marker to indicate this is a GWC cache.
client.putProperties(keyBuilder.storeMetadata(), new Properties());
// deletes are a complicated beast, we have a dedicated class to run them
- deleteManager =
- new DeleteManager(
- client, lockProvider, keyBuilder, configuration.getMaxConnections());
+ deleteManager = new DeleteManager(client, lockProvider, keyBuilder, configuration.getMaxConnections());
deleteManager.issuePendingBulkDeletes();
}
@@ -114,24 +109,21 @@ public boolean delete(String layerName) throws StorageException {
}
@Override
- public boolean deleteByParametersId(String layerName, String parametersId)
- throws StorageException {
+ public boolean deleteByParametersId(String layerName, String parametersId) throws StorageException {
checkNotNull(layerName, "layerName");
checkNotNull(parametersId, "parametersId");
- boolean prefixExists =
- keyBuilder.forParameters(layerName, parametersId).stream()
- .map(
- prefix -> {
- try {
- return deleteManager.scheduleAsyncDelete(prefix);
- } catch (StorageException e) {
- throw new UncheckedIOException(e);
- }
- })
- .reduce(Boolean::logicalOr) // Don't use Stream.anyMatch as it would short
- // circuit
- .orElse(false);
+ boolean prefixExists = keyBuilder.forParameters(layerName, parametersId).stream()
+ .map(prefix -> {
+ try {
+ return deleteManager.scheduleAsyncDelete(prefix);
+ } catch (StorageException e) {
+ throw new UncheckedIOException(e);
+ }
+ })
+ .reduce(Boolean::logicalOr) // Don't use Stream.anyMatch as it would short
+ // circuit
+ .orElse(false);
if (prefixExists) {
listeners.sendParametersDeleted(layerName, parametersId);
}
@@ -139,8 +131,7 @@ public boolean deleteByParametersId(String layerName, String parametersId)
}
@Override
- public boolean deleteByGridsetId(final String layerName, final String gridSetId)
- throws StorageException {
+ public boolean deleteByGridsetId(final String layerName, final String gridSetId) throws StorageException {
checkNotNull(layerName, "layerName");
checkNotNull(gridSetId, "gridSetId");
@@ -200,33 +191,26 @@ public boolean delete(TileRange tileRange) throws StorageException {
}
// open an iterator oer tile locations, to avoid memory accumulation
- final Iterator tileLocations =
- new AbstractIterator<>() {
+ final Iterator tileLocations = new AbstractIterator<>() {
- // TileRange iterator with 1x1 meta tiling factor
- private TileRangeIterator trIter =
- new TileRangeIterator(tileRange, new int[] {1, 1});
+ // TileRange iterator with 1x1 meta tiling factor
+ private TileRangeIterator trIter = new TileRangeIterator(tileRange, new int[] {1, 1});
- @Override
- protected long[] computeNext() {
- long[] gridLoc = trIter.nextMetaGridLocation(new long[3]);
- return gridLoc == null ? endOfData() : gridLoc;
- }
- };
+ @Override
+ protected long[] computeNext() {
+ long[] gridLoc = trIter.nextMetaGridLocation(new long[3]);
+ return gridLoc == null ? endOfData() : gridLoc;
+ }
+ };
// if no listeners, we don't need to gather extra tile info, use a dedicated fast path
if (listeners.isEmpty()) {
// if there are no listeners, don't bother requesting every tile
// metadata to notify the listeners
- Iterator keysIterator =
- Iterators.transform(
- tileLocations,
- tl ->
- keyBuilder.forLocation(
- coordsPrefix, tl, tileRange.getMimeType()));
+ Iterator keysIterator = Iterators.transform(
+ tileLocations, tl -> keyBuilder.forLocation(coordsPrefix, tl, tileRange.getMimeType()));
// split the iteration in parts to avoid memory accumulation
- Iterator> partition =
- Iterators.partition(keysIterator, DeleteManager.PAGE_SIZE);
+ Iterator> partition = Iterators.partition(keysIterator, DeleteManager.PAGE_SIZE);
while (partition.hasNext() && !shutDown) {
List locations = partition.next();
@@ -242,18 +226,12 @@ protected long[] computeNext() {
String format = tileRange.getMimeType().getFormat();
Map parameters = tileRange.getParameters();
- Iterator> tilesIterator =
- Iterators.transform(
- tileLocations,
- xyz -> {
- TileObject tile =
- TileObject.createQueryTileObject(
- layerName, xyz, gridSetId, format, parameters);
- tile.setParametersId(tileRange.getParametersId());
- return (Callable) () -> delete(tile);
- });
- Iterator>> partition =
- Iterators.partition(tilesIterator, DeleteManager.PAGE_SIZE);
+ Iterator> tilesIterator = Iterators.transform(tileLocations, xyz -> {
+ TileObject tile = TileObject.createQueryTileObject(layerName, xyz, gridSetId, format, parameters);
+ tile.setParametersId(tileRange.getParametersId());
+ return (Callable) () -> delete(tile);
+ });
+ Iterator>> partition = Iterators.partition(tilesIterator, DeleteManager.PAGE_SIZE);
// once a page of callables is ready, run them in parallel on the delete manager
while (partition.hasNext() && !shutDown) {
@@ -322,11 +300,7 @@ public void put(TileObject obj) throws StorageException {
client.upload(key, data, mimeType);
} catch (StorageException e) {
throw new StorageException(
- "Failed to upload tile to Azure on container "
- + client.getContainerName()
- + " and key "
- + key,
- e);
+ "Failed to upload tile to Azure on container " + client.getContainerName() + " and key " + key, e);
} catch (IOException e) {
throw new StorageException("Error obtaining date from TileObject " + obj);
}
@@ -354,8 +328,7 @@ private String getMimeType(TileObject obj) {
return mimeType;
}
- private void putParametersMetadata(
- String layerName, String parametersId, Map parameters) {
+ private void putParametersMetadata(String layerName, String parametersId, Map parameters) {
assert (isNull(parametersId) == isNull(parameters));
if (isNull(parametersId)) {
return;
diff --git a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreConfigProvider.java b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreConfigProvider.java
index 972d1548a0..8be31e96ac 100644
--- a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreConfigProvider.java
+++ b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreConfigProvider.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
diff --git a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreData.java b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreData.java
index db30d793c2..b31d44d64f 100644
--- a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreData.java
+++ b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreData.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Fernando Mino, GeoSolutions, Copyright 2019
*/
@@ -18,10 +17,7 @@
import java.net.Proxy;
import org.geowebcache.GeoWebCacheEnvironment;
-/**
- * Azure Blobstore type-resolved data from a {@link AzureBlobStoreInfo} using enviroment variables
- * if enabled.
- */
+/** Azure Blobstore type-resolved data from a {@link AzureBlobStoreInfo} using enviroment variables if enabled. */
public class AzureBlobStoreData {
private String container;
@@ -38,14 +34,11 @@ public class AzureBlobStoreData {
public AzureBlobStoreData() {}
- public AzureBlobStoreData(
- final AzureBlobStoreInfo storeInfo, final GeoWebCacheEnvironment environment) {
+ public AzureBlobStoreData(final AzureBlobStoreInfo storeInfo, final GeoWebCacheEnvironment environment) {
environment
.resolveValueIfEnabled(storeInfo.getContainer(), String.class)
.ifPresent(x -> this.container = x);
- environment
- .resolveValueIfEnabled(storeInfo.getPrefix(), String.class)
- .ifPresent(x -> this.prefix = x);
+ environment.resolveValueIfEnabled(storeInfo.getPrefix(), String.class).ifPresent(x -> this.prefix = x);
environment
.resolveValueIfEnabled(storeInfo.getAccountName(), String.class)
.ifPresent(x -> this.accountName = x);
@@ -175,9 +168,7 @@ public String getLocation() {
Proxy getProxy() {
if (proxyHost != null) {
- return new Proxy(
- Proxy.Type.HTTP,
- new InetSocketAddress(proxyHost, proxyPort != null ? proxyPort : 8888));
+ return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort != null ? proxyPort : 8888));
}
return null;
}
diff --git a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreInfo.java b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreInfo.java
index dcbadc6b3b..43978b6369 100644
--- a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreInfo.java
+++ b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureBlobStoreInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -34,9 +33,8 @@ public class AzureBlobStoreInfo extends BlobStoreInfo {
private static final long serialVersionUID = -8068069256598987874L;
/**
- * Max number of connections used inside the Netty HTTP client. Might seem a lot, but when
- * deleting we have to issue a delete on each single tile, so we need a large parallelism to
- * make that feasible
+ * Max number of connections used inside the Netty HTTP client. Might seem a lot, but when deleting we have to issue
+ * a delete on each single tile, so we need a large parallelism to make that feasible
*/
public static final int DEFAULT_CONNECTIONS = 100;
@@ -107,8 +105,7 @@ public void setServiceURL(String serviceURL) {
}
/**
- * Returns the base prefix, which is a prefix path to use as the root to store tiles under the
- * container.
+ * Returns the base prefix, which is a prefix path to use as the root to store tiles under the container.
*
* @return optional string for a "base prefix"
*/
@@ -131,9 +128,7 @@ public void setMaxConnections(String maxConnections) {
this.maxConnections = maxConnections;
}
- /**
- * @return whether to use HTTPS (true) or HTTP (false) when talking to Azure (defaults to true)
- */
+ /** @return whether to use HTTPS (true) or HTTP (false) when talking to Azure (defaults to true) */
public Boolean isUseHTTPS() {
return useHTTPS;
}
@@ -183,8 +178,7 @@ public void setProxyPort(String proxyPort) {
/**
* Returns the optional proxy user name to use if connecting through a proxy.
*
- * @return The optional proxy user name the configured client will use if connecting through a
- * proxy.
+ * @return The optional proxy user name the configured client will use if connecting through a proxy.
*/
@Nullable
public String getProxyUsername() {
@@ -220,18 +214,13 @@ public void setProxyPassword(String proxyPassword) {
}
@Override
- public BlobStore createInstance(TileLayerDispatcher layers, LockProvider lockProvider)
- throws StorageException {
+ public BlobStore createInstance(TileLayerDispatcher layers, LockProvider lockProvider) throws StorageException {
checkNotNull(layers);
checkState(getName() != null);
- checkState(
- isEnabled(),
- "Can't call AzureBlobStoreConfig.createInstance() is blob store is not enabled");
- if (log.isLoggable(Level.FINE))
- log.fine("Creating Azure Blob Store instance [name=" + getName() + "]");
+ checkState(isEnabled(), "Can't call AzureBlobStoreConfig.createInstance() is blob store is not enabled");
+ if (log.isLoggable(Level.FINE)) log.fine("Creating Azure Blob Store instance [name=" + getName() + "]");
final AzureBlobStoreData storeData =
- new AzureBlobStoreData(
- this, GeoWebCacheExtensions.bean(GeoWebCacheEnvironment.class));
+ new AzureBlobStoreData(this, GeoWebCacheExtensions.bean(GeoWebCacheEnvironment.class));
return new AzureBlobStore(storeData, layers, lockProvider);
}
diff --git a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureClient.java b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureClient.java
index eb8b3ad524..69ee385c2c 100644
--- a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureClient.java
+++ b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/AzureClient.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -93,11 +92,10 @@ BlobServiceClient createBlobServiceClient(AzureBlobStoreData configuration) {
AzureNamedKeyCredential creds = getCredentials(configuration);
ClientOptions clientOpts = new ClientOptions();
HttpClient httpClient = createHttpClient(configuration);
- BlobServiceClientBuilder builder =
- new BlobServiceClientBuilder()
- .endpoint(serviceURL)
- .clientOptions(clientOpts)
- .httpClient(httpClient);
+ BlobServiceClientBuilder builder = new BlobServiceClientBuilder()
+ .endpoint(serviceURL)
+ .clientOptions(clientOpts)
+ .httpClient(httpClient);
if (null != creds) {
builder = builder.credential(creds);
}
@@ -193,9 +191,7 @@ public Properties getProperties(String key) {
byte[] bytes = getBytes(key);
if (bytes != null) {
try {
- properties.load(
- new InputStreamReader(
- new ByteArrayInputStream(bytes), StandardCharsets.UTF_8));
+ properties.load(new InputStreamReader(new ByteArrayInputStream(bytes), StandardCharsets.UTF_8));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
@@ -211,13 +207,11 @@ public void putProperties(String resourceKey, Properties properties) throws Stor
try {
upload(resourceKey, data, contentType);
} catch (StorageException e) {
- throw new StorageException(
- "Failed to update e property file at " + resourceKey, e.getCause());
+ throw new StorageException("Failed to update e property file at " + resourceKey, e.getCause());
}
}
- public void upload(String resourceKey, BinaryData data, String contentType)
- throws StorageException {
+ public void upload(String resourceKey, BinaryData data, String contentType) throws StorageException {
BlockBlobSimpleUploadOptions upload = new BlockBlobSimpleUploadOptions(data);
upload.setHeaders(new BlobHttpHeaders().setContentType(contentType));
@@ -233,8 +227,7 @@ public void upload(String resourceKey, BinaryData data, String contentType)
}
int status = response.getStatusCode();
if (!HttpStatus.valueOf(status).is2xxSuccessful()) {
- throw new StorageException(
- "Upload request failed with status " + status + " on resource " + resourceKey);
+ throw new StorageException("Upload request failed with status " + status + " on resource " + resourceKey);
}
}
@@ -258,8 +251,8 @@ public boolean prefixExists(String prefix) {
/**
* @param prefix
- * @return an internally paged Stream, with the default items-per-page setting of {@link
- * ListBlobsOptions#getMaxResultsPerPage() 5000}
+ * @return an internally paged Stream, with the default items-per-page setting of
+ * {@link ListBlobsOptions#getMaxResultsPerPage() 5000}
*/
public Stream listBlobs(String prefix) {
return listBlobs(prefix, 5_000);
@@ -267,8 +260,8 @@ public Stream listBlobs(String prefix) {
/**
* @param prefix
- * @param maxResultsPerPage used to control how many items Azure will return per page. It's not
- * the max results to return entirely, so use it with caution.
+ * @param maxResultsPerPage used to control how many items Azure will return per page. It's not the max results to
+ * return entirely, so use it with caution.
* @return an internally paged (as per {@code maxResultsPerPage}) Stream.
*/
public Stream listBlobs(String prefix, int maxResultsPerPage) {
diff --git a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/DeleteManager.java b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/DeleteManager.java
index 0c5e4204d6..b1795be83c 100644
--- a/geowebcache/azureblob/src/main/java/org/geowebcache/azure/DeleteManager.java
+++ b/geowebcache/azureblob/src/main/java/org/geowebcache/azure/DeleteManager.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -48,21 +47,18 @@
import org.geowebcache.util.TMSKeyBuilder;
/**
- * Class handling deletes, which are normally handled in an asynchronous way in all other stores as
- * well. These are bulk operations like deleting an entire layer, or a rangeset, with potentially
- * million of tiles involved.
+ * Class handling deletes, which are normally handled in an asynchronous way in all other stores as well. These are bulk
+ * operations like deleting an entire layer, or a rangeset, with potentially million of tiles involved.
*
- *
Unfortunately the Azure BLOB API has no concept of bulk delete, and no concept of containment
- * either, so tiles have to be enumerated one by one and a delete issued on each one. This calls for
- * a parallel execution, and requires avoiding accumulation of references to all tiles that need
- * removing in memory, as they could be millions or more, hence code that tries to run over the
- * tiles in pages
+ *
Unfortunately the Azure BLOB API has no concept of bulk delete, and no concept of containment either, so tiles
+ * have to be enumerated one by one and a delete issued on each one. This calls for a parallel execution, and requires
+ * avoiding accumulation of references to all tiles that need removing in memory, as they could be millions or more,
+ * hence code that tries to run over the tiles in pages
*/
class DeleteManager implements Closeable {
/**
- * the page size here is not about limiting the requests, but ensures that we don't end up using
- * too much memory while processing millions of tiles, that would be otherwise all queued on the
- * {@link ExecutorService}
+ * the page size here is not about limiting the requests, but ensures that we don't end up using too much memory
+ * while processing millions of tiles, that would be otherwise all queued on the {@link ExecutorService}
*/
static final int PAGE_SIZE = 1000;
@@ -73,26 +69,20 @@ class DeleteManager implements Closeable {
private ExecutorService deleteExecutor;
private Map pendingDeletesKeyTime = new ConcurrentHashMap<>();
- public DeleteManager(
- AzureClient client, LockProvider locks, TMSKeyBuilder keyBuilder, int maxConnections) {
+ public DeleteManager(AzureClient client, LockProvider locks, TMSKeyBuilder keyBuilder, int maxConnections) {
this.keyBuilder = keyBuilder;
this.client = client;
this.locks = locks;
this.concurrency = maxConnections;
- this.deleteExecutor =
- createDeleteExecutorService(client.getContainerName(), maxConnections);
+ this.deleteExecutor = createDeleteExecutorService(client.getContainerName(), maxConnections);
}
- private static ExecutorService createDeleteExecutorService(
- String containerName, int parallelism) {
- ThreadFactory tf =
- new ThreadFactoryBuilder()
- .setDaemon(true)
- .setNameFormat(
- "GWC AzureBlobStore bulk delete thread-%d. Container: "
- + containerName)
- .setPriority(Thread.MIN_PRIORITY)
- .build();
+ private static ExecutorService createDeleteExecutorService(String containerName, int parallelism) {
+ ThreadFactory tf = new ThreadFactoryBuilder()
+ .setDaemon(true)
+ .setNameFormat("GWC AzureBlobStore bulk delete thread-%d. Container: " + containerName)
+ .setPriority(Thread.MIN_PRIORITY)
+ .build();
return Executors.newFixedThreadPool(parallelism, tf);
}
@@ -102,9 +92,7 @@ private long currentTimeSeconds() {
return Instant.now().getEpochSecond();
}
- /**
- * Executes the provided iterator of callables on the delete executor, returning their results
- */
+ /** Executes the provided iterator of callables on the delete executor, returning their results */
public void executeParallel(List> callables) throws StorageException {
List> futures = new ArrayList<>();
for (Callable> callable : callables) {
@@ -119,10 +107,7 @@ public void executeParallel(List> callables) throws StorageException
}
}
- /**
- * Executes the removal of the specified keys in a parallel fashion, returning the number of
- * removed keys
- */
+ /** Executes the removal of the specified keys in a parallel fashion, returning the number of removed keys */
public Long deleteParallel(List keys) throws StorageException {
try {
return new KeysBulkDelete(keys).call();
@@ -133,10 +118,9 @@ public Long deleteParallel(List keys) throws StorageException {
public boolean scheduleAsyncDelete(final String prefix) throws StorageException {
final long timestamp = currentTimeSeconds();
- String msg =
- String.format(
- "Issuing bulk delete on '%s/%s' for objects older than %d",
- client.getContainerName(), prefix, timestamp);
+ String msg = String.format(
+ "Issuing bulk delete on '%s/%s' for objects older than %d",
+ client.getContainerName(), prefix, timestamp);
log.info(msg);
try {
@@ -174,10 +158,9 @@ public void issuePendingBulkDeletes() throws StorageException {
final String prefix = e.getKey().toString();
final long timestamp = Long.parseLong(e.getValue().toString());
if (log.isLoggable(Level.INFO))
- log.info(
- String.format(
- "Restarting pending bulk delete on '%s/%s':%d",
- client.getContainerName(), prefix, timestamp));
+ log.info(String.format(
+ "Restarting pending bulk delete on '%s/%s':%d",
+ client.getContainerName(), prefix, timestamp));
if (!asyncDelete(prefix, timestamp)) {
deletesToClear.add(prefix);
}
@@ -235,10 +218,8 @@ public Long call() throws Exception {
try {
checkInterrupted();
if (log.isLoggable(Level.INFO))
- log.info(
- String.format(
- "Running bulk delete on '%s/%s':%d",
- client.getContainerName(), prefix, timestamp));
+ log.info(String.format(
+ "Running bulk delete on '%s/%s':%d", client.getContainerName(), prefix, timestamp));
BlobContainerClient container = client.getContainer();
@@ -256,10 +237,9 @@ public Long call() throws Exception {
}
}
} catch (InterruptedException | IllegalStateException e) {
- log.info(
- String.format(
- "Azure bulk delete aborted for '%s/%s'. Will resume on next startup.",
- client.getContainerName(), prefix));
+ log.info(String.format(
+ "Azure bulk delete aborted for '%s/%s'. Will resume on next startup.",
+ client.getContainerName(), prefix));
throw e;
} catch (RuntimeException e) {
log.log(
@@ -272,10 +252,9 @@ public Long call() throws Exception {
}
if (log.isLoggable(Level.INFO))
- log.info(
- String.format(
- "Finished bulk delete on '%s/%s':%d. %d objects deleted",
- client.getContainerName(), prefix, timestamp, count));
+ log.info(String.format(
+ "Finished bulk delete on '%s/%s':%d. %d objects deleted",
+ client.getContainerName(), prefix, timestamp, count));
clearPendingBulkDelete(prefix, timestamp);
return count;
@@ -287,8 +266,7 @@ private boolean equalOrAfter(BlobItem blobItem) {
return timestamp >= lastModifiedSecs;
}
- private void clearPendingBulkDelete(final String prefix, final long timestamp)
- throws GeoWebCacheException {
+ private void clearPendingBulkDelete(final String prefix, final long timestamp) throws GeoWebCacheException {
Long taskTime = pendingDeletesKeyTime.get(prefix);
if (taskTime == null) {
return; // someone else cleared it up for us. A task that run after this one but
@@ -303,15 +281,13 @@ private void clearPendingBulkDelete(final String prefix, final long timestamp)
try {
Properties deletes = client.getProperties(pendingDeletesKey);
String storedVal = (String) deletes.remove(prefix);
- long storedTimestamp =
- storedVal == null ? Long.MIN_VALUE : Long.parseLong(storedVal);
+ long storedTimestamp = storedVal == null ? Long.MIN_VALUE : Long.parseLong(storedVal);
if (timestamp >= storedTimestamp) {
client.putProperties(pendingDeletesKey, deletes);
} else if (log.isLoggable(Level.INFO)) {
- log.info(
- String.format(
- "bulk delete finished but there's a newer one ongoing for container '%s/%s'",
- client.getContainerName(), prefix));
+ log.info(String.format(
+ "bulk delete finished but there's a newer one ongoing for container '%s/%s'",
+ client.getContainerName(), prefix));
}
} catch (StorageException e) {
throw new UncheckedIOException(e);
@@ -320,21 +296,16 @@ private void clearPendingBulkDelete(final String prefix, final long timestamp)
}
}
- private long deleteItems(
- BlobContainerClient container, List segment, Predicate filter)
+ private long deleteItems(BlobContainerClient container, List segment, Predicate filter)
throws ExecutionException, InterruptedException {
- List> collect =
- segment.stream()
- .filter(filter)
- .map(
- item ->
- deleteExecutor.submit(
- () -> {
- deleteItem(container, item.getName());
- return null;
- }))
- .collect(Collectors.toList());
+ List> collect = segment.stream()
+ .filter(filter)
+ .map(item -> deleteExecutor.submit(() -> {
+ deleteItem(container, item.getName());
+ return null;
+ }))
+ .collect(Collectors.toList());
for (Future f : collect) {
f.get();
@@ -357,11 +328,9 @@ public Long call() throws Exception {
try {
checkInterrupted();
if (log.isLoggable(Level.FINER)) {
- log.finer(
- String.format(
- "Running delete delete on list of items on '%s':%s ... (only the first 100 items listed)",
- client.getContainerName(),
- keys.subList(0, Math.min(keys.size(), 100))));
+ log.finer(String.format(
+ "Running delete delete on list of items on '%s':%s ... (only the first 100 items listed)",
+ client.getContainerName(), keys.subList(0, Math.min(keys.size(), 100))));
}
BlobContainerClient container = client.getContainer();
@@ -378,19 +347,16 @@ public Long call() throws Exception {
}
if (log.isLoggable(Level.INFO))
- log.info(
- String.format(
- "Finished bulk delete on %s, %d objects deleted",
- client.getContainerName(), count));
+ log.info(String.format(
+ "Finished bulk delete on %s, %d objects deleted", client.getContainerName(), count));
return count;
}
private long deleteItems(BlobContainerClient container, List itemNames)
throws ExecutionException, InterruptedException {
- List> collect =
- itemNames.stream()
- .map(item -> deleteExecutor.submit(() -> deleteItem(container, item)))
- .collect(Collectors.toList());
+ List> collect = itemNames.stream()
+ .map(item -> deleteExecutor.submit(() -> deleteItem(container, item)))
+ .collect(Collectors.toList());
for (Future f : collect) {
f.get();
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreConfigProviderTest.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreConfigProviderTest.java
index 81af95560a..9bb82f3611 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreConfigProviderTest.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreConfigProviderTest.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -34,8 +33,7 @@ public void setUp() throws Exception {
System.setProperty("CONNECTIONS", "30");
System.setProperty("ENABLED", "true");
System.setProperty("ALLOW_ENV_PARAMETRIZATION", "true");
- ClassPathXmlApplicationContext context =
- new ClassPathXmlApplicationContext("appContextTestAzure.xml");
+ ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("appContextTestAzure.xml");
GeoWebCacheExtensions gse = new GeoWebCacheExtensions();
gse.setApplicationContext(context);
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreConformanceTest.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreConformanceTest.java
index e38cc0ad92..ddcca34d62 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreConformanceTest.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreConformanceTest.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Kevin Smith, Boundless, 2017
*/
@@ -48,23 +47,19 @@ public void createTestUnit() throws Exception {
TileLayerDispatcher layers = createMock(TileLayerDispatcher.class);
LockProvider lockProvider = new NoOpLockProvider();
Stream.of("testLayer", "testLayer1", "testLayer2")
- .map(
- name -> {
- TileLayer mock = createMock(name, TileLayer.class);
- expect(mock.getName()).andStubReturn(name);
- expect(mock.getId()).andStubReturn(name);
- expect(mock.getGridSubsets())
- .andStubReturn(Collections.singleton("testGridSet"));
- expect(mock.getMimeTypes())
- .andStubReturn(
- Arrays.asList(org.geowebcache.mime.ImageMime.png));
- try {
- expect(layers.getTileLayer(eq(name))).andStubReturn(mock);
- } catch (GeoWebCacheException e) {
- fail();
- }
- return mock;
- })
+ .map(name -> {
+ TileLayer mock = createMock(name, TileLayer.class);
+ expect(mock.getName()).andStubReturn(name);
+ expect(mock.getId()).andStubReturn(name);
+ expect(mock.getGridSubsets()).andStubReturn(Collections.singleton("testGridSet"));
+ expect(mock.getMimeTypes()).andStubReturn(Arrays.asList(org.geowebcache.mime.ImageMime.png));
+ try {
+ expect(layers.getTileLayer(eq(name))).andStubReturn(mock);
+ } catch (GeoWebCacheException e) {
+ fail();
+ }
+ return mock;
+ })
.forEach(EasyMock::replay);
replay(layers);
store = new AzureBlobStore(config, layers, lockProvider);
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreDataTest.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreDataTest.java
index bafee3db62..de94fa5d3e 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreDataTest.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreDataTest.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Fernando Mino, GeoSolutions, Copyright 2019
*/
@@ -33,8 +32,7 @@ public void setUp() throws Exception {
System.setProperty("ACCOUNT_KEY", "MYKEY");
System.setProperty("CONNECTIONS", "30");
System.setProperty("ALLOW_ENV_PARAMETRIZATION", "true");
- ClassPathXmlApplicationContext context =
- new ClassPathXmlApplicationContext("appContextTestAzure.xml");
+ ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("appContextTestAzure.xml");
GeoWebCacheExtensions gse = new GeoWebCacheExtensions();
gse.setApplicationContext(context);
}
@@ -50,8 +48,7 @@ public void tearDown() throws Exception {
@Test
public void testEnvironmentProperties() {
- GeoWebCacheEnvironment typedEnvironment =
- GeoWebCacheExtensions.bean(GeoWebCacheEnvironment.class);
+ GeoWebCacheEnvironment typedEnvironment = GeoWebCacheExtensions.bean(GeoWebCacheEnvironment.class);
final AzureBlobStoreInfo storeInfo = new AzureBlobStoreInfo("info1");
storeInfo.setContainer("${CONTAINER}");
storeInfo.setAccountName("${ACCOUNT_NAME}");
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreIntegrationTest.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreIntegrationTest.java
index 5906f9e7b2..6b2dab5d51 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreIntegrationTest.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreIntegrationTest.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -285,8 +284,7 @@ public void testDeleteLayer() throws Exception {
// check the tiles are gone too, give it up to 100 seconds
long start = System.currentTimeMillis();
boolean t20Deleted = false, t21Deleted = false, t22Deleted = false;
- while (System.currentTimeMillis() - start < 100000
- && (!t20Deleted || !t21Deleted || !t22Deleted)) {
+ while (System.currentTimeMillis() - start < 100000 && (!t20Deleted || !t21Deleted || !t22Deleted)) {
if (!t20Deleted) {
tile.getXYZ()[0] = 20;
@@ -325,34 +323,21 @@ public void testDeleteGridSubset() throws Exception {
// deletion by gridset is asynch, so we might have to wait a bit
boolean t4326PngDeleted = false, t4326JpegDeleted = false;
long start = System.currentTimeMillis();
- while (System.currentTimeMillis() - start < 100000
- && (!t4326PngDeleted || !t4326JpegDeleted)) {
+ while (System.currentTimeMillis() - start < 100000 && (!t4326PngDeleted || !t4326JpegDeleted)) {
if (!t4326PngDeleted) {
- t4326PngDeleted =
- !blobStore.get(queryTile(DEFAULT_LAYER, "EPSG:4326", "png", 0, 0, 0));
+ t4326PngDeleted = !blobStore.get(queryTile(DEFAULT_LAYER, "EPSG:4326", "png", 0, 0, 0));
}
if (!t4326JpegDeleted) {
t4326JpegDeleted =
- !blobStore.get(
- queryTile(
- DEFAULT_LAYER,
- "EPSG:4326",
- "jpeg",
- 0,
- 0,
- 0,
- "param",
- "value"));
+ !blobStore.get(queryTile(DEFAULT_LAYER, "EPSG:4326", "jpeg", 0, 0, 0, "param", "value"));
}
}
assertTrue(t4326PngDeleted);
assertTrue(t4326JpegDeleted);
// these two should not have been touched
assertTrue(blobStore.get(queryTile(DEFAULT_LAYER, "EPSG:3857", "png", 0, 0, 0)));
- assertTrue(
- blobStore.get(
- queryTile(DEFAULT_LAYER, "EPSG:3857", "jpeg", 0, 0, 0, "param", "value")));
+ assertTrue(blobStore.get(queryTile(DEFAULT_LAYER, "EPSG:3857", "jpeg", 0, 0, 0, "param", "value")));
}
@Test
@@ -366,8 +351,7 @@ public void testLayerMetadata() {
}
@Test
- public void testTruncateShortCutsIfNoTilesInParametersPrefix()
- throws StorageException, MimeException {
+ public void testTruncateShortCutsIfNoTilesInParametersPrefix() throws StorageException, MimeException {
final int zoomStart = 0;
final int zoomStop = 1;
seed(zoomStart, zoomStop);
@@ -375,8 +359,7 @@ public void testTruncateShortCutsIfNoTilesInParametersPrefix()
blobStore.addListener(listener);
GridSet gridset =
- new GridSetBroker(Collections.singletonList(new DefaultGridsets(false, false)))
- .getWorldEpsg4326();
+ new GridSetBroker(Collections.singletonList(new DefaultGridsets(false, false))).getWorldEpsg4326();
GridSubset gridSubSet = GridSubsetFactory.createGridSubSet(gridset);
long[][] rangeBounds = { //
@@ -388,14 +371,7 @@ public void testTruncateShortCutsIfNoTilesInParametersPrefix()
// use a parameters map for which there're no tiles
Map parameters = ImmutableMap.of("someparam", "somevalue");
TileRange tileRange =
- tileRange(
- DEFAULT_LAYER,
- DEFAULT_GRIDSET,
- zoomStart,
- zoomStop,
- rangeBounds,
- mimeType,
- parameters);
+ tileRange(DEFAULT_LAYER, DEFAULT_GRIDSET, zoomStart, zoomStop, rangeBounds, mimeType, parameters);
assertFalse(blobStore.delete(tileRange));
verify(listener, times(0))
@@ -411,8 +387,7 @@ public void testTruncateShortCutsIfNoTilesInParametersPrefix()
}
@Test
- public void testTruncateShortCutsIfNoTilesInGridsetPrefix()
- throws StorageException, MimeException {
+ public void testTruncateShortCutsIfNoTilesInGridsetPrefix() throws StorageException, MimeException {
final int zoomStart = 0;
final int zoomStop = 1;
@@ -422,8 +397,7 @@ public void testTruncateShortCutsIfNoTilesInGridsetPrefix()
// use a gridset for which there're no tiles
GridSet gridset =
- new GridSetBroker(Collections.singletonList(new DefaultGridsets(false, true)))
- .getWorldEpsg3857();
+ new GridSetBroker(Collections.singletonList(new DefaultGridsets(false, true))).getWorldEpsg3857();
GridSubset gridSubSet = GridSubsetFactory.createGridSubSet(gridset);
long[][] rangeBounds = { //
@@ -435,26 +409,12 @@ public void testTruncateShortCutsIfNoTilesInGridsetPrefix()
Map parameters = null;
TileRange tileRange =
- tileRange(
- DEFAULT_LAYER,
- gridset.getName(),
- zoomStart,
- zoomStop,
- rangeBounds,
- mimeType,
- parameters);
+ tileRange(DEFAULT_LAYER, gridset.getName(), zoomStart, zoomStop, rangeBounds, mimeType, parameters);
assertFalse(blobStore.delete(tileRange));
verify(listener, times(0))
.tileDeleted(
- anyString(),
- anyString(),
- anyString(),
- anyString(),
- anyLong(),
- anyLong(),
- anyInt(),
- anyLong());
+ anyString(), anyString(), anyString(), anyString(), anyLong(), anyLong(), anyInt(), anyLong());
}
/** Seed levels 0 to 2, truncate levels 0 and 1, check level 2 didn't get deleted */
@@ -466,8 +426,7 @@ public void testTruncateRespectsLevels() throws StorageException, MimeException
// use a gridset for which there're no tiles
GridSet gridset =
- new GridSetBroker(Collections.singletonList(new DefaultGridsets(false, true)))
- .getWorldEpsg3857();
+ new GridSetBroker(Collections.singletonList(new DefaultGridsets(false, true))).getWorldEpsg3857();
GridSubset gridSubSet = GridSubsetFactory.createGridSubSet(gridset);
long[][] rangeBounds = gridSubSet.getCoverages();
@@ -483,15 +442,8 @@ public void testTruncateRespectsLevels() throws StorageException, MimeException
final int truncateStart = 0, truncateStop = 1;
- TileRange tileRange =
- tileRange(
- DEFAULT_LAYER,
- gridset.getName(),
- truncateStart,
- truncateStop,
- rangeBounds,
- mimeType,
- parameters);
+ TileRange tileRange = tileRange(
+ DEFAULT_LAYER, gridset.getName(), truncateStart, truncateStop, rangeBounds, mimeType, parameters);
assertTrue(blobStore.delete(tileRange));
@@ -513,10 +465,7 @@ private static String anyStringOrNull() {
return or(isNull(), anyString());
}
- /**
- * If there are not {@link BlobStoreListener}s, use an optimized code path (not calling delete()
- * for each tile)
- */
+ /** If there are not {@link BlobStoreListener}s, use an optimized code path (not calling delete() for each tile) */
@Test
@SuppressWarnings("unchecked")
public void testTruncateOptimizationIfNoListeners() throws StorageException, MimeException {
@@ -538,15 +487,8 @@ public void testTruncateOptimizationIfNoListeners() throws StorageException, Mim
final int truncateStart = 0, truncateStop = 1;
- TileRange tileRange =
- tileRange(
- DEFAULT_LAYER,
- DEFAULT_GRIDSET,
- truncateStart,
- truncateStop,
- rangeBounds,
- mimeType,
- parameters);
+ TileRange tileRange = tileRange(
+ DEFAULT_LAYER, DEFAULT_GRIDSET, truncateStart, truncateStop, rangeBounds, mimeType, parameters);
@SuppressWarnings("PMD.CloseResource") // closed by the store
DeleteManager deleteManager = Mockito.spy(blobStore.deleteManager);
@@ -580,14 +522,7 @@ private TileRange tileRange(
Map parameters) {
TileRange tileRange =
- new TileRange(
- layerName,
- gridSetId,
- zoomStart,
- zoomStop,
- rangeBounds,
- mimeType,
- parameters);
+ new TileRange(layerName, gridSetId, zoomStart, zoomStop, rangeBounds, mimeType, parameters);
return tileRange;
}
@@ -596,15 +531,10 @@ private void seed(int zoomStart, int zoomStop) throws StorageException {
}
private void seed(
- int zoomStart,
- int zoomStop,
- String gridset,
- String formatExtension,
- Map parameters)
+ int zoomStart, int zoomStop, String gridset, String formatExtension, Map parameters)
throws StorageException {
- Preconditions.checkArgument(
- zoomStop < 5, "don't use high zoom levels for integration testing");
+ Preconditions.checkArgument(zoomStop < 5, "don't use high zoom levels for integration testing");
for (int z = zoomStart; z <= zoomStop; z++) {
int max = (int) Math.pow(2, z);
for (int x = 0; x < max; x++) {
@@ -617,12 +547,7 @@ private void seed(
}
private TileObject put(
- long x,
- long y,
- int z,
- String gridset,
- String formatExtension,
- Map parameters)
+ long x, long y, int z, String gridset, String formatExtension, Map parameters)
throws StorageException {
return put(x, y, z, DEFAULT_LAYER, gridset, formatExtension, parameters);
}
@@ -648,19 +573,12 @@ private TileObject queryTile(long x, long y, int z) {
return queryTile(DEFAULT_LAYER, DEFAULT_GRIDSET, DEFAULT_FORMAT, x, y, z);
}
- private TileObject queryTile(
- String layer, String gridset, String extension, long x, long y, int z) {
+ private TileObject queryTile(String layer, String gridset, String extension, long x, long y, int z) {
return queryTile(layer, gridset, extension, x, y, z, (Map) null);
}
private TileObject queryTile(
- String layer,
- String gridset,
- String extension,
- long x,
- long y,
- int z,
- String... parameters) {
+ String layer, String gridset, String extension, long x, long y, int z, String... parameters) {
Map parametersMap = null;
if (parameters != null) {
@@ -673,13 +591,7 @@ private TileObject queryTile(
}
private TileObject queryTile(
- String layer,
- String gridset,
- String extension,
- long x,
- long y,
- int z,
- Map parameters) {
+ String layer, String gridset, String extension, long x, long y, int z, Map parameters) {
String format;
try {
@@ -688,9 +600,7 @@ private TileObject queryTile(
throw new RuntimeException(e);
}
- TileObject tile =
- TileObject.createQueryTileObject(
- layer, new long[] {x, y, z}, gridset, format, parameters);
+ TileObject tile = TileObject.createQueryTileObject(layer, new long[] {x, y, z}, gridset, format, parameters);
return tile;
}
}
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreSuitabilityTest.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreSuitabilityTest.java
index ea56ca3d92..75a8a0fa60 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreSuitabilityTest.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/AzureBlobStoreSuitabilityTest.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Kevin Smith, Boundless, 2018
*/
@@ -84,11 +83,9 @@ public BlobStore create(Object dir) throws Exception {
for (String path : (String[]) dir) {
String fullPath = info.getPrefix() + "/" + path;
BinaryData data = BinaryData.fromString("testAbc");
- Response response =
- getClient()
- .getBlockBlobClient(fullPath)
- .uploadWithResponse(
- new BlockBlobSimpleUploadOptions(data), null, Context.NONE);
+ Response response = getClient()
+ .getBlockBlobClient(fullPath)
+ .uploadWithResponse(new BlockBlobSimpleUploadOptions(data), null, Context.NONE);
assertTrue(HttpStatus.valueOf(response.getStatusCode()).is2xxSuccessful());
}
return new AzureBlobStore(info, tld, locks);
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreConformanceIT.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreConformanceIT.java
index aae6b52cdd..4babeb11f2 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreConformanceIT.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreConformanceIT.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2024
*/
@@ -25,8 +24,7 @@
* Runs {@link AzureBlobStoreConformanceTest} tests against a local ephemeral Docker container using
* {@link AzuriteContainer}.
*
- *
If there's no Docker environment, the test is {@link AzuriteContainer#disabledWithoutDocker()
- * ignored}
+ *
If there's no Docker environment, the test is {@link AzuriteContainer#disabledWithoutDocker() ignored}
*/
public class AzuriteAzureBlobStoreConformanceIT extends AzureBlobStoreConformanceTest {
@@ -34,7 +32,8 @@ public class AzuriteAzureBlobStoreConformanceIT extends AzureBlobStoreConformanc
public static AzuriteContainer azurite = AzuriteContainer.latest().disabledWithoutDocker();
/** Used to get a per-test case Azure container */
- @Rule public TestName testName = new TestName();
+ @Rule
+ public TestName testName = new TestName();
@Override
protected AzureBlobStoreData getConfiguration() {
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreIntegrationIT.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreIntegrationIT.java
index ac5ca2763d..5a2e030629 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreIntegrationIT.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreIntegrationIT.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2024
*/
@@ -25,8 +24,7 @@
* Runs {@link AzureBlobStoreIntegrationTest} tests against a local ephemeral Docker container using
* {@link AzuriteContainer}.
*
- *
If there's no Docker environment, the test is {@link AzuriteContainer#disabledWithoutDocker()
- * ignored}
+ *
If there's no Docker environment, the test is {@link AzuriteContainer#disabledWithoutDocker() ignored}
*/
public class AzuriteAzureBlobStoreIntegrationIT extends AzureBlobStoreIntegrationTest {
@@ -34,7 +32,8 @@ public class AzuriteAzureBlobStoreIntegrationIT extends AzureBlobStoreIntegratio
public static AzuriteContainer azurite = AzuriteContainer.latest().disabledWithoutDocker();
/** Used to get a per-test case Azure container */
- @Rule public TestName testName = new TestName();
+ @Rule
+ public TestName testName = new TestName();
@Override
protected AzureBlobStoreData getConfiguration() {
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreSuitabilityIT.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreSuitabilityIT.java
index ed7298e8d8..6a78054f22 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreSuitabilityIT.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/container/AzuriteAzureBlobStoreSuitabilityIT.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2024
*/
@@ -29,8 +28,7 @@
* Runs {@link AzureBlobStoreConformanceTest} tests against a local ephemeral Docker container using
* {@link AzuriteContainer}.
*
- *
If there's no Docker environment, the test is {@link AzuriteContainer#disabledWithoutDocker()
- * ignored}
+ *
If there's no Docker environment, the test is {@link AzuriteContainer#disabledWithoutDocker() ignored}
*/
public class AzuriteAzureBlobStoreSuitabilityIT extends AzureBlobStoreSuitabilityTest {
@@ -38,7 +36,8 @@ public class AzuriteAzureBlobStoreSuitabilityIT extends AzureBlobStoreSuitabilit
public static AzuriteContainer azurite = AzuriteContainer.latest().disabledWithoutDocker();
/** Used to get a per-test case Azure container */
- @Rule public TestName testName = new TestName();
+ @Rule
+ public TestName testName = new TestName();
@Override
protected AzureBlobStoreData getConfiguration() {
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreConformanceIT.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreConformanceIT.java
index ab89916d5b..d2fe450a1a 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreConformanceIT.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreConformanceIT.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Kevin Smith, Boundless, 2017
*/
@@ -23,8 +22,7 @@ public class OnlineAzureBlobStoreConformanceIT extends AzureBlobStoreConformance
public PropertiesLoader testConfigLoader = new PropertiesLoader();
@Rule
- public TemporaryAzureFolder tempFolder =
- new TemporaryAzureFolder(testConfigLoader.getProperties());
+ public TemporaryAzureFolder tempFolder = new TemporaryAzureFolder(testConfigLoader.getProperties());
@Override
protected AzureBlobStoreData getConfiguration() {
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreIntegrationIT.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreIntegrationIT.java
index 9571021536..45a0b1e7ab 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreIntegrationIT.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreIntegrationIT.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -27,8 +26,7 @@ public class OnlineAzureBlobStoreIntegrationIT extends AzureBlobStoreIntegration
private PropertiesLoader testConfigLoader = new PropertiesLoader();
@Rule
- public TemporaryAzureFolder tempFolder =
- new TemporaryAzureFolder(testConfigLoader.getProperties());
+ public TemporaryAzureFolder tempFolder = new TemporaryAzureFolder(testConfigLoader.getProperties());
@Override
protected AzureBlobStoreData getConfiguration() {
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreSuitabilityIT.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreSuitabilityIT.java
index c996d07529..793bf8f602 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreSuitabilityIT.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/OnlineAzureBlobStoreSuitabilityIT.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Kevin Smith, Boundless, 2018
*/
@@ -32,8 +31,7 @@ public class OnlineAzureBlobStoreSuitabilityIT extends AzureBlobStoreSuitability
public PropertiesLoader testConfigLoader = new PropertiesLoader();
@Rule
- public TemporaryAzureFolder tempFolder =
- new TemporaryAzureFolder(testConfigLoader.getProperties());
+ public TemporaryAzureFolder tempFolder = new TemporaryAzureFolder(testConfigLoader.getProperties());
@Override
protected AzureBlobStoreData getConfiguration() {
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/PropertiesLoader.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/PropertiesLoader.java
index 80c9887ce9..8ea67e9429 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/PropertiesLoader.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/PropertiesLoader.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -26,14 +25,13 @@
import org.geotools.util.logging.Logging;
/**
- * Loads the configuration from a properties file {@code $HOME/.gwc_azure_tests.properties}, which
- * must exist and contain entries for {@code container}, {@code accountName}, and {@code
- * accountKey}.
+ * Loads the configuration from a properties file {@code $HOME/.gwc_azure_tests.properties}, which must exist and
+ * contain entries for {@code container}, {@code accountName}, and {@code accountKey}.
*
*
If the file doesn't exist, the returned {@link #getProperties()} will be empty.
*
- *
If the file does exist and doesn't contain one of the required keys, the constructor fails
- * with an {@link IllegalArgumentException}.
+ *
If the file does exist and doesn't contain one of the required keys, the constructor fails with an
+ * {@link IllegalArgumentException}.
*/
public class PropertiesLoader {
@@ -44,8 +42,7 @@ public class PropertiesLoader {
public PropertiesLoader() {
String home = System.getProperty("user.home");
File configFile = new File(home, ".gwc_azure_tests.properties");
- log.info(
- "Loading Azure tests config. File must have keys 'container', 'accountName', and 'accountKey'");
+ log.info("Loading Azure tests config. File must have keys 'container', 'accountName', and 'accountKey'");
if (configFile.exists()) {
try (InputStream in = new FileInputStream(configFile)) {
properties.load(in);
@@ -59,15 +56,11 @@ public PropertiesLoader() {
null != properties.getProperty("accountKey"),
"accountKey not provided in config file " + configFile.getAbsolutePath());
} catch (IOException e) {
- log.log(
- Level.SEVERE,
- "Error loading Azure tests config: " + configFile.getAbsolutePath(),
- e);
+ log.log(Level.SEVERE, "Error loading Azure tests config: " + configFile.getAbsolutePath(), e);
}
} else {
- log.warning(
- "Azure storage config file not found. Azure Azure tests will be ignored. "
- + configFile.getAbsolutePath());
+ log.warning("Azure storage config file not found. Azure Azure tests will be ignored. "
+ + configFile.getAbsolutePath());
}
}
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/TemporaryAzureFolder.java b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/TemporaryAzureFolder.java
index c6d8222b76..2344011740 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/TemporaryAzureFolder.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/azure/tests/online/TemporaryAzureFolder.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Andrea Aime, GeoSolutions, Copyright 2019
*/
@@ -27,8 +26,8 @@
import org.junit.rules.ExternalResource;
/**
- * The TemporaryAzureFolder provides a path prefix for Azure storage and deletes all resources under
- * the given prefix at shutdown.
+ * The TemporaryAzureFolder provides a path prefix for Azure storage and deletes all resources under the given prefix at
+ * shutdown.
*/
public class TemporaryAzureFolder extends ExternalResource {
@@ -116,13 +115,10 @@ public void delete() {
}
try (Stream blobs = client.listBlobs(temporaryPrefix)) {
- blobs.forEach(
- blob -> {
- BlockBlobClient blockBlobURL = client.getBlockBlobClient(blob.getName());
- assertTrue(
- "Expected success while deleting " + blob.getName(),
- blockBlobURL.deleteIfExists());
- });
+ blobs.forEach(blob -> {
+ BlockBlobClient blockBlobURL = client.getBlockBlobClient(blob.getName());
+ assertTrue("Expected success while deleting " + blob.getName(), blockBlobURL.deleteIfExists());
+ });
}
}
diff --git a/geowebcache/azureblob/src/test/java/org/geowebcache/testcontainers/azure/AzuriteContainer.java b/geowebcache/azureblob/src/test/java/org/geowebcache/testcontainers/azure/AzuriteContainer.java
index 857122c6fe..82466f2ff5 100644
--- a/geowebcache/azureblob/src/test/java/org/geowebcache/testcontainers/azure/AzuriteContainer.java
+++ b/geowebcache/azureblob/src/test/java/org/geowebcache/testcontainers/azure/AzuriteContainer.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2024
*/
@@ -31,20 +30,18 @@
/**
* Testcontainers container for AWS Azurite Azure
- * Storage Emulator.
+ * "https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite">Azurite Azure Storage Emulator.
*
*
Runs the Azurite
* Docker image for local Azure Storage development with testcontainers.
*
- *
Azurite sets up the following well-known account and key for the Azure Storage Emulator,
- * available through {@link #getAccountName()} and {@link #getAccountKey()}:
+ *
Azurite sets up the following well-known account and key for the Azure Storage Emulator, available through
+ * {@link #getAccountName()} and {@link #getAccountKey()}:
*
*
* Account name: {@code devstoreaccount1}
- * Account key: {@code
- * Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==}
+ * Account key: {@code Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==}
*
*
* Usage: For Junit 4, use it as a {@code @Rule} or {@code @ClassRule}:
@@ -101,8 +98,8 @@ public static AzuriteContainer latest() {
/**
* Disables the tests using this testcontainer if there's no Docker environment available.
*
- *
Same effect as JUnit 5's {@code
- * org.testcontainers.junit.jupiter.@Testcontainers(disabledWithoutDocker = true)}
+ *
Same effect as JUnit 5's {@code org.testcontainers.junit.jupiter.@Testcontainers(disabledWithoutDocker =
+ * true)}
*/
public AzuriteContainer disabledWithoutDocker() {
this.disabledWithoutDocker = true;
@@ -110,9 +107,9 @@ public AzuriteContainer disabledWithoutDocker() {
}
/**
- * Overrides to apply the {@link Assume assumption} checking the Docker environment is available
- * if {@link #disabledWithoutDocker() enabled}, so this test container can be used as a {@code
- * ClassRule @ClassRule} and hence avoid running a container for each test case.
+ * Overrides to apply the {@link Assume assumption} checking the Docker environment is available if
+ * {@link #disabledWithoutDocker() enabled}, so this test container can be used as a {@code ClassRule @ClassRule}
+ * and hence avoid running a container for each test case.
*/
@Override
@SuppressWarnings("deprecation")
@@ -137,12 +134,11 @@ public String getAccountKey() {
/**
* Returns the localhost port where the azurite blob storage service is running.
*
- *
when in {@link #legacy() legacy} mode, a small http proxy is run and the proxy port is
- * returned. The proxy fixes some protocol issues. For instance, re-writes the returned response
- * headers {@code etag}, {@code last-modified}, and {@code content-type}, as {@code Etag},
- * {@code Last-Modified}, and {@code Content-Type}, respectively, as expected by the Netty
- * version the legacy {@code com.microsoft.azure:azure-storage-blob} dependency transitively
- * carries over.
+ *
when in {@link #legacy() legacy} mode, a small http proxy is run and the proxy port is returned. The proxy
+ * fixes some protocol issues. For instance, re-writes the returned response headers {@code etag},
+ * {@code last-modified}, and {@code content-type}, as {@code Etag}, {@code Last-Modified}, and
+ * {@code Content-Type}, respectively, as expected by the Netty version the legacy
+ * {@code com.microsoft.azure:azure-storage-blob} dependency transitively carries over.
*/
public int getBlobsPort() {
return super.getMappedPort(blobsPort);
diff --git a/geowebcache/core/src/main/java/org/geowebcache/ClientStreamAbortedException.java b/geowebcache/core/src/main/java/org/geowebcache/ClientStreamAbortedException.java
index 9aa31a2377..87046325b9 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/ClientStreamAbortedException.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/ClientStreamAbortedException.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -17,12 +16,11 @@
import java.io.IOException;
/**
- * An IOException that means a {@link
- * ServiceStrategy#getDestination(javax.servlet.http.HttpServletResponse) ServiceStrategy's
- * destination} IO operation has been abruptly interrupted while writing a response.
+ * An IOException that means a {@link ServiceStrategy#getDestination(javax.servlet.http.HttpServletResponse)
+ * ServiceStrategy's destination} IO operation has been abruptly interrupted while writing a response.
*
- *
This exception serves as an indicator to the dispatching system that there's no need to report
- * the exception back to the client.
+ *
This exception serves as an indicator to the dispatching system that there's no need to report the exception back
+ * to the client.
*
* @author Gabriel Roldan (TOPP)
* @version $Id$
diff --git a/geowebcache/core/src/main/java/org/geowebcache/DispatcherOutputStream.java b/geowebcache/core/src/main/java/org/geowebcache/DispatcherOutputStream.java
index 623d764d87..15e548e14a 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/DispatcherOutputStream.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/DispatcherOutputStream.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -20,9 +19,8 @@
import javax.servlet.WriteListener;
/**
- * A wrapper for a Dispatcher destination output stream that signals {@link IOException}s thrown
- * while writing to the underlying destination as ignorable for OWS exception reporting, by throwing
- * a {@link ClientStreamAbortedException}.
+ * A wrapper for a Dispatcher destination output stream that signals {@link IOException}s thrown while writing to the
+ * underlying destination as ignorable for OWS exception reporting, by throwing a {@link ClientStreamAbortedException}.
*
* @author Gabriel Roldan (TOPP)
* @version $Id$
diff --git a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCache.java b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCache.java
index b85fc47c47..da047338f6 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCache.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCache.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -18,8 +17,7 @@
public class GeoWebCache {
/** @return current the GWC version */
- @SuppressWarnings(
- "deprecation") // Package.getPackage is deprecated in java 11 but replacement is not
+ @SuppressWarnings("deprecation") // Package.getPackage is deprecated in java 11 but replacement is not
// available in Java 8
public static String getVersion() {
Package versionInfo = Package.getPackage("org.geowebcache");
@@ -28,8 +26,7 @@ public static String getVersion() {
}
/** @return the current build revision number/hash */
- @SuppressWarnings(
- "deprecation") // Package.getPackage is deprecated in java 11 but replacement is not
+ @SuppressWarnings("deprecation") // Package.getPackage is deprecated in java 11 but replacement is not
// available in Java 8
public static String getBuildRevision() {
Package versionInfo = Package.getPackage("org.geowebcache");
diff --git a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheDispatcher.java b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheDispatcher.java
index 3d155116fa..d271c7af25 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheDispatcher.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheDispatcher.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, The Open Planning Project, Copyright 2008
*/
@@ -137,10 +136,7 @@ public void setDefaultStorageFinder(DefaultStorageFinder defaultStorageFinder) {
this.defaultStorageFinder = defaultStorageFinder;
}
- /**
- * GeoServer and other solutions that embedded this dispatcher will prepend a path, this is used
- * to remove it.
- */
+ /** GeoServer and other solutions that embedded this dispatcher will prepend a path, this is used to remove it. */
public void setServletPrefix(String servletPrefix) {
if (!servletPrefix.startsWith("/")) {
this.servletPrefix = "/" + servletPrefix;
@@ -150,20 +146,16 @@ public void setServletPrefix(String servletPrefix) {
LOG.config("Invoked setServletPrefix(" + servletPrefix + ")");
}
- /**
- * GeoServer and other solutions that embedded this dispatcher will prepend a path, this is used
- * to remove it.
- */
+ /** GeoServer and other solutions that embedded this dispatcher will prepend a path, this is used to remove it. */
public String getServletPrefix() {
return servletPrefix;
}
/**
- * Services convert HTTP requests into the internal grid representation and specify what layer
- * the response should come from.
+ * Services convert HTTP requests into the internal grid representation and specify what layer the response should
+ * come from.
*
- *
The application context is scanned for objects extending Service, thereby making it easy
- * to add new services.
+ *
The application context is scanned for objects extending Service, thereby making it easy to add new services.
*/
private Map loadServices() {
LOG.info("Loading GWC Service extensions...");
@@ -174,15 +166,12 @@ private Map loadServices() {
for (Service aService : plugins) {
services.put(aService.getPathName(), aService);
}
- LOG.info(
- "Done loading GWC Service extensions. Found : "
- + new ArrayList<>(services.keySet()));
+ LOG.info("Done loading GWC Service extensions. Found : " + new ArrayList<>(services.keySet()));
return services;
}
private void loadBlankTile() {
- String blankTilePath =
- defaultStorageFinder.findEnvVar(DefaultStorageFinder.GWC_BLANK_TILE_PATH);
+ String blankTilePath = defaultStorageFinder.findEnvVar(DefaultStorageFinder.GWC_BLANK_TILE_PATH);
if (blankTilePath != null) {
File fh = new File(blankTilePath);
@@ -260,16 +249,15 @@ String normalizeURL(HttpServletRequest request) {
* If a tile is requested the request will be handed off to handleServiceRequest.
*/
@Override
- protected ModelAndView handleRequestInternal(
- HttpServletRequest request, HttpServletResponse originalResponse) throws Exception {
+ protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse originalResponse)
+ throws Exception {
- HttpServletResponseWrapper response =
- new HttpServletResponseWrapper(originalResponse) {
- @Override
- public ServletOutputStream getOutputStream() throws IOException {
- return new DispatcherOutputStream(super.getOutputStream());
- }
- };
+ HttpServletResponseWrapper response = new HttpServletResponseWrapper(originalResponse) {
+ @Override
+ public ServletOutputStream getOutputStream() throws IOException {
+ return new DispatcherOutputStream(super.getOutputStream());
+ }
+ };
// Break the request into components, {type, service name}
String[] requestComps = null;
@@ -290,8 +278,7 @@ public ServletOutputStream getOutputStream() throws IOException {
|| requestComps[0].equalsIgnoreCase(TYPE_DEMO + "s")) {
handleDemoRequest(requestComps[1], request, response);
} else {
- ResponseUtils.writeErrorPage(
- response, 404, "Unknown path: " + requestComps[0], runtimeStats);
+ ResponseUtils.writeErrorPage(response, 404, "Unknown path: " + requestComps[0], runtimeStats);
}
} catch (HttpErrorCodeException e) {
ResponseUtils.writeFixedResponse(
@@ -361,10 +348,7 @@ private boolean isClientStreamAbortedException(Throwable t) {
return false;
}
- /**
- * Destroy function, has to be referenced in bean declaration: ...
- */
+ /** Destroy function, has to be referenced in bean declaration: ... */
public void destroy() {
LOG.fine("GeoWebCacheDispatcher.destroy() was invoked, shutting down.");
}
@@ -390,8 +374,7 @@ private String[] parseRequest(String servletPath) throws GeoWebCacheException {
}
/** This is the main method for handling service requests. See comments in the code. */
- private void handleServiceRequest(
- String serviceStr, HttpServletRequest request, HttpServletResponse response)
+ private void handleServiceRequest(String serviceStr, HttpServletRequest request, HttpServletResponse response)
throws Exception {
Conveyor conv = null;
@@ -407,11 +390,7 @@ private void handleServiceRequest(
if (Objects.nonNull(layerName)) {
layer = tileLayerDispatcher.getTileLayer(layerName);
if (!layer.isEnabled()) {
- throw new OWSException(
- 400,
- "InvalidParameterValue",
- "LAYERS",
- "Layer '" + layerName + "' is disabled");
+ throw new OWSException(400, "InvalidParameterValue", "LAYERS", "Layer '" + layerName + "' is disabled");
}
if (conv instanceof ConveyorTile) {
((ConveyorTile) conv).setTileLayer(layer);
@@ -426,17 +405,11 @@ private void handleServiceRequest(
service.handleRequest(conv);
} else {
ResponseUtils.writeTile(
- getSecurityDispatcher(),
- conv,
- layerName,
- tileLayerDispatcher,
- defaultStorageFinder,
- runtimeStats);
+ getSecurityDispatcher(), conv, layerName, tileLayerDispatcher, defaultStorageFinder, runtimeStats);
}
}
- private void handleDemoRequest(
- String action, HttpServletRequest request, HttpServletResponse response)
+ private void handleDemoRequest(String action, HttpServletRequest request, HttpServletResponse response)
throws GeoWebCacheException {
Demo.makeMap(tileLayerDispatcher, gridSetBroker, action, request, response);
}
@@ -489,48 +462,35 @@ private void handleFrontPage(HttpServletRequest request, HttpServletResponse res
commitId = "{NO BUILD INFO IN MANIFEST}";
}
- str.append(
- "\n"
- + ServletUtils.gwcHtmlHeader(baseUrl, "GWC Home")
- + "
\n"
- + ServletUtils.gwcHtmlLogoLink(baseUrl));
- str.append(
- "Welcome to GeoWebCache version "
- + version
- + ", build "
- + commitId
- + " \n");
- str.append(
- "GeoWebCache is an advanced tile cache for WMS servers.");
+ str.append("\n"
+ + ServletUtils.gwcHtmlHeader(baseUrl, "GWC Home")
+ + "
\n"
+ + ServletUtils.gwcHtmlLogoLink(baseUrl));
+ str.append("Welcome to GeoWebCache version " + version + ", build " + commitId + " \n");
+ str.append("GeoWebCache is an advanced tile cache for WMS servers.");
str.append(
"It supports a large variety of protocols and formats, including WMS-C, WMTS, KML, Google Maps and Virtual Earth.
");
str.append("Automatically Generated Demos: \n");
str.append(
- "\n");
+ "\n");
str.append("GetCapabilities: \n");
- str.append(
- "\n");
if (runtimeStats != null) {
str.append("Runtime Statistics \n");
str.append(runtimeStats.getHTMLStats());
str.append("\n");
}
- if (!Boolean.parseBoolean(
- GeoWebCacheExtensions.getProperty("GEOWEBCACHE_HIDE_STORAGE_LOCATIONS"))) {
+ if (!Boolean.parseBoolean(GeoWebCacheExtensions.getProperty("GEOWEBCACHE_HIDE_STORAGE_LOCATIONS"))) {
appendStorageLocations(str);
}
@@ -539,8 +499,7 @@ private void handleFrontPage(HttpServletRequest request, HttpServletResponse res
}
str.append("\n");
- ResponseUtils.writePage(
- response, 200, str.toString(), runtimeStats, MediaType.TEXT_HTML_VALUE);
+ ResponseUtils.writePage(response, 200, str.toString(), runtimeStats, MediaType.TEXT_HTML_VALUE);
}
private void appendStorageLocations(StringBuilder str) {
@@ -602,8 +561,8 @@ private void appendStorageLocations(StringBuilder str) {
}
/**
- * This method appends the cache statistics to the GWC homepage if the blobstore used is an
- * instance of the {@link MemoryBlobStore} class
+ * This method appends the cache statistics to the GWC homepage if the blobstore used is an instance of the
+ * {@link MemoryBlobStore} class
*
* @param strGlobal Input {@link StringBuilder} containing the HTML for the GWC homepage
*/
@@ -667,9 +626,8 @@ private void appendInternalCacheStats(StringBuilder strGlobal) {
str.append("");
- str.append(
- "Total number of requests: "
- + (requestCount >= 0 ? requestCount + "" : "Unavailable"));
+ str.append(" Total number of requests: "
+ + (requestCount >= 0 ? requestCount + "" : "Unavailable"));
str.append(" \n");
str.append(" ");
@@ -692,25 +650,20 @@ private void appendInternalCacheStats(StringBuilder strGlobal) {
str.append(" ");
- str.append(
- "Total number of evicted tiles: "
- + (evictionCount >= 0 ? evictionCount + "" : "Unavailable"));
+ str.append(" Total number of evicted tiles: "
+ + (evictionCount >= 0 ? evictionCount + "" : "Unavailable"));
str.append(" \n");
str.append(" ");
- str.append(
- "Cache Memory occupation: "
- + (currentMemory >= 0 ? currentMemory + " %" : "Unavailable"));
+ str.append(" Cache Memory occupation: "
+ + (currentMemory >= 0 ? currentMemory + " %" : "Unavailable"));
str.append(" \n");
str.append(" ");
- str.append(
- "Cache Actual Size/ Total Size : "
- + (totalSize >= 0 && actualSize >= 0
- ? actualSize + " / " + totalSize + " Mb"
- : "Unavailable"));
+ str.append(" Cache Actual Size/ Total Size : "
+ + (totalSize >= 0 && actualSize >= 0 ? actualSize + " / " + totalSize + " Mb" : "Unavailable"));
str.append(" \n");
str.append(" ");
diff --git a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheEnvironment.java b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheEnvironment.java
index dbff374ceb..e3c7ba4bd2 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheEnvironment.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheEnvironment.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Alessio Fabiani, GeoSolutions S.A.S., Copyright 2017
*/
@@ -27,8 +26,7 @@
import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver;
/**
- * Utility class uses to process GeoWebCache configuration workflow through external environment
- * variables.
+ * Utility class uses to process GeoWebCache configuration workflow through external environment variables.
*
*
This class must be used everytime we need to resolve a configuration placeholder at runtime.
*
@@ -40,8 +38,8 @@
*
*
*
- * It must be a singleton, and must not be loaded lazily. Furthermore, this bean must be loaded
- * before any beans that use it.
+ * It must be a singleton, and must not be loaded lazily. Furthermore, this bean must be loaded before any beans that
+ * use it.
*
* @author Alessio Fabiani, GeoSolutions
*/
@@ -53,8 +51,8 @@ public class GeoWebCacheEnvironment {
private static final Constants constants = new Constants(PlaceholderConfigurerSupport.class);
/**
- * Constant set via System Environment in order to instruct GeoWebCache to make use or not of
- * the config placeholders translation.
+ * Constant set via System Environment in order to instruct GeoWebCache to make use or not of the config
+ * placeholders translation.
*
*
Default to FALSE
*/
@@ -63,15 +61,13 @@ public class GeoWebCacheEnvironment {
private static final String nullValue = "null";
- private final PropertyPlaceholderHelper helper =
- new PropertyPlaceholderHelper(
- constants.asString("DEFAULT_PLACEHOLDER_PREFIX"),
- constants.asString("DEFAULT_PLACEHOLDER_SUFFIX"),
- constants.asString("DEFAULT_VALUE_SEPARATOR"),
- true);
+ private final PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper(
+ constants.asString("DEFAULT_PLACEHOLDER_PREFIX"),
+ constants.asString("DEFAULT_PLACEHOLDER_SUFFIX"),
+ constants.asString("DEFAULT_VALUE_SEPARATOR"),
+ true);
- private final PlaceholderResolver resolver =
- placeholderName -> resolvePlaceholder(placeholderName);
+ private final PlaceholderResolver resolver = placeholderName -> resolvePlaceholder(placeholderName);
private Properties props;
@@ -126,11 +122,10 @@ protected String resolveStringValue(String strVal) throws BeansException {
}
/**
- * Translates placeholders in the form of Spring Property placemark ${...} into their real
- * values.
+ * Translates placeholders in the form of Spring Property placemark ${...} into their real values.
*
- *
The method first looks for System variables which take precedence on local ones, then into
- * internal props injected through the applicationContext.
+ *
The method first looks for System variables which take precedence on local ones, then into internal props
+ * injected through the applicationContext.
*/
public Object resolveValue(Object value) {
if (value != null) {
@@ -170,13 +165,11 @@ public Optional resolveValueIfEnabled(final String value,
Integer intValue = Integer.valueOf(resultValue);
return (Optional) Optional.of(intValue);
} catch (NumberFormatException ex) {
- throw new IllegalArgumentException(
- "Illegal String parameter: Resolved value is not an integer.", ex);
+ throw new IllegalArgumentException("Illegal String parameter: Resolved value is not an integer.", ex);
}
} else if (type.isAssignableFrom(Boolean.class)) {
if (!validateBoolean(resultValue))
- throw new IllegalArgumentException(
- "Illegal String parameter: Resolved value is not a boolean.");
+ throw new IllegalArgumentException("Illegal String parameter: Resolved value is not a boolean.");
Boolean boolValue = Boolean.valueOf(value);
return (Optional) Optional.of(boolValue);
}
diff --git a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheException.java b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheException.java
index 3f1508bf1b..39eb5aa0c1 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheException.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheException.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, The Open Planning Project, Copyright 2008
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheExtensionPriority.java b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheExtensionPriority.java
index 27a03aed7e..1e3c6f8f64 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheExtensionPriority.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheExtensionPriority.java
@@ -1,22 +1,20 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
package org.geowebcache;
/**
- * Interface implemented by extensions which require control over the order in which they are
- * processed.
+ * Interface implemented by extensions which require control over the order in which they are processed.
*
*
This the same interface of GeoServer extension priority.
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheExtensions.java b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheExtensions.java
index 8cee7cd9ac..056988ba43 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheExtensions.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/GeoWebCacheExtensions.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -42,11 +41,10 @@
*
* <bean id="gwowebCacheExtensions" class="org.geowebcache.GeoWebCacheExtensions"/>
*
- * It must be a singleton, and must not be loaded lazily. Furthermore, this bean must be
- * loaded before any beans that use it.
+ * It must be a singleton, and must not be loaded lazily. Furthermore, this bean must be loaded before any beans
+ * that use it.
*
- * Priority will be respected for extensions that implement {@link GeoWebCacheExtensionPriority}
- * interface.
+ *
Priority will be respected for extensions that implement {@link GeoWebCacheExtensionPriority} interface.
*
* @author Gabriel Roldan based on GeoServer's {@code GeoServerExtensions}
*/
@@ -56,9 +54,8 @@ public class GeoWebCacheExtensions implements ApplicationContextAware, Applicati
private static Logger LOGGER = Logging.getLogger(GeoWebCacheExtensions.class.getName());
/**
- * Caches the names of the beans for a particular type, so that the lookup (expensive) wont' be
- * needed. We cache names instead of beans because doing the latter we would break the
- * "singleton=false" directive of some beans
+ * Caches the names of the beans for a particular type, so that the lookup (expensive) wont' be needed. We cache
+ * names instead of beans because doing the latter we would break the "singleton=false" directive of some beans
*/
static WeakHashMap, String[]> extensionsCache = new WeakHashMap<>(40);
@@ -68,8 +65,8 @@ public class GeoWebCacheExtensions implements ApplicationContextAware, Applicati
/**
* Sets the web application context to be used for looking up extensions.
*
- * This method is called by the spring container, and should never be called by client code.
- * If client needs to supply a particular context, methods which take a context are available.
+ *
This method is called by the spring container, and should never be called by client code. If client needs to
+ * supply a particular context, methods which take a context are available.
*
*
This is the context that is used for methods which dont supply their own context.
*/
@@ -88,8 +85,7 @@ public void setApplicationContext(ApplicationContext context) throws BeansExcept
* @return A collection of the extensions, or an empty collection.
*/
@SuppressWarnings("unchecked")
- public static final List extensions(
- Class extensionPoint, ApplicationContext context) {
+ public static final List extensions(Class extensionPoint, ApplicationContext context) {
String[] names;
if (GeoWebCacheExtensions.context == context) {
names = extensionsCache.get(extensionPoint);
@@ -128,12 +124,11 @@ public static final List extensions(
}
/**
- * Return all bean names that correspond to the provided extension type. If the provided
- * extensions type implements the {@link GeoWebCacheExtensionPriority} interface, they are
- * returned sorted by priority
+ * Return all bean names that correspond to the provided extension type. If the provided extensions type implements
+ * the {@link GeoWebCacheExtensionPriority} interface, they are returned sorted by priority
*
- * We return the bean names and not the beans themselves because we cache the beans by name
- * rather than the bean itself to avoid breaking the singleton directive.
+ *
We return the bean names and not the beans themselves because we cache the beans by name rather than the bean
+ * itself to avoid breaking the singleton directive.
*
* @param extensionType type of beans to return
* @return Array of sorted bean names
@@ -143,16 +138,14 @@ public static String[] getBeansNamesOrderedByPriority(Class extensionType
}
/**
- * We lookup all the beans names that correspond to the provided extension type. If the provided
- * extensions type implements the {@link GeoWebCacheExtensionPriority} interface we sort the
- * beans names by their priority.
+ * We lookup all the beans names that correspond to the provided extension type. If the provided extensions type
+ * implements the {@link GeoWebCacheExtensionPriority} interface we sort the beans names by their priority.
*
- * We return the bean names and not the beans themselves because we cache the beans by name
- * rather than the bean itself to avoid breaking the singleton directive.
+ *
We return the bean names and not the beans themselves because we cache the beans by name rather than the bean
+ * itself to avoid breaking the singleton directive.
*/
@SuppressWarnings("unchecked")
- private static String[] getBeansNamesOrderedByPriority(
- Class extensionType, ApplicationContext context) {
+ private static String[] getBeansNamesOrderedByPriority(Class extensionType, ApplicationContext context) {
// asking spring for a map that will contains all beans that match the extensions type
// indexed by their name
Map beans = context.getBeansOfType(extensionType);
@@ -163,22 +156,16 @@ private static String[] getBeansNamesOrderedByPriority(
// this extension type is priority aware
List> beansEntries = new ArrayList<>(beans.entrySet());
// sorting beans by their priority
- Collections.sort(
- beansEntries,
- (extensionA, extensionB) -> {
- GeoWebCacheExtensionPriority extensionPriorityA =
- ((Map.Entry) extensionA)
- .getValue();
- GeoWebCacheExtensionPriority extensionPriorityB =
- ((Map.Entry) extensionB)
- .getValue();
- if (extensionPriorityA.getPriority() < extensionPriorityB.getPriority()) {
- return -1;
- }
- return extensionPriorityA.getPriority() == extensionPriorityB.getPriority()
- ? 0
- : 1;
- });
+ Collections.sort(beansEntries, (extensionA, extensionB) -> {
+ GeoWebCacheExtensionPriority extensionPriorityA =
+ ((Map.Entry) extensionA).getValue();
+ GeoWebCacheExtensionPriority extensionPriorityB =
+ ((Map.Entry) extensionB).getValue();
+ if (extensionPriorityA.getPriority() < extensionPriorityB.getPriority()) {
+ return -1;
+ }
+ return extensionPriorityA.getPriority() == extensionPriorityB.getPriority() ? 0 : 1;
+ });
// returning only the beans names
return beansEntries.stream().map(Map.Entry::getKey).toArray(String[]::new);
}
@@ -186,8 +173,8 @@ private static String[] getBeansNamesOrderedByPriority(
/**
* Loads all extensions implementing or extending extensionPoint
.
*
- * This method uses the "default" application context to perform the lookup. See {@link
- * #setApplicationContext(ApplicationContext)}.
+ *
This method uses the "default" application context to perform the lookup. See
+ * {@link #setApplicationContext(ApplicationContext)}.
*
* @param extensionPoint The class or interface of the extensions.
* @return A collection of the extensions, or an empty collection.
@@ -204,11 +191,7 @@ public static final List extensions(Class extensionPoint) {
public static List configurations(
Class extensionPoint, ApplicationContext context) {
return extensions(extensionPoint, context).stream()
- .sorted(
- (x, y) ->
- Integer.signum(
- x.getPriority(extensionPoint)
- - y.getPriority(extensionPoint)))
+ .sorted((x, y) -> Integer.signum(x.getPriority(extensionPoint) - y.getPriority(extensionPoint)))
.collect(Collectors.toList());
}
@@ -237,10 +220,7 @@ public static void reinitialize(ApplicationContext context) {
+ ((BaseConfiguration) bean).getLocation(),
e);
} else {
- LOGGER.log(
- Level.SEVERE,
- "Error while preparing bean to reinitialize " + bean.toString(),
- e);
+ LOGGER.log(Level.SEVERE, "Error while preparing bean to reinitialize " + bean.toString(), e);
}
}
}
@@ -257,8 +237,7 @@ public static void reinitialize(ApplicationContext context) {
+ ((BaseConfiguration) bean).getLocation(),
e);
} else {
- LOGGER.log(
- Level.SEVERE, "Error while reinitializing bean " + bean.toString(), e);
+ LOGGER.log(Level.SEVERE, "Error while reinitializing bean " + bean.toString(), e);
}
}
}
@@ -278,12 +257,11 @@ public static final Object bean(String name, ApplicationContext context) {
/**
* Loads a single bean by its type.
*
- * This method returns null if there is no such bean. An exception is thrown if multiple
- * beans of the specified type exist.
+ *
This method returns null if there is no such bean. An exception is thrown if multiple beans of the specified
+ * type exist.
*
* @param type THe type of the bean to lookup.
- * @throws IllegalArgumentException If there are multiple beans of the specified type in the
- * context.
+ * @throws IllegalArgumentException If there are multiple beans of the specified type in the context.
*/
public static final T bean(Class type) throws IllegalArgumentException {
checkContext(context);
@@ -293,16 +271,14 @@ public static final T bean(Class type) throws IllegalArgumentException {
/**
* Loads a single bean by its type from the specified application context.
*
- * This method returns null if there is no such bean. An exception is thrown if multiple
- * beans of the specified type exist.
+ *
This method returns null if there is no such bean. An exception is thrown if multiple beans of the specified
+ * type exist.
*
* @param type THe type of the bean to lookup.
* @param context The application context
- * @throws IllegalArgumentException If there are multiple beans of the specified type in the
- * context.
+ * @throws IllegalArgumentException If there are multiple beans of the specified type in the context.
*/
- public static final T bean(Class type, ApplicationContext context)
- throws IllegalArgumentException {
+ public static final T bean(Class type, ApplicationContext context) throws IllegalArgumentException {
List beans = extensions(type, context);
if (beans.isEmpty()) {
return null;
@@ -328,11 +304,11 @@ static void checkContext(ApplicationContext context) {
}
/**
- * Looks up for a named string property in the order defined by {@link #getProperty(String,
- * ApplicationContext)} using the internally cached spring application context.
+ * Looks up for a named string property in the order defined by {@link #getProperty(String, ApplicationContext)}
+ * using the internally cached spring application context.
*
- * Care should be taken when using this method. It should not be called during startup or
- * from tests cases as the internal context will not have been set.
+ *
Care should be taken when using this method. It should not be called during startup or from tests cases as the
+ * internal context will not have been set.
*
* @param propertyName The property name to lookup.
* @return The property value, or null if not found
@@ -387,9 +363,7 @@ public static String getProperty(String propertyName, ServletContext context) {
// than strictly necessary
final String[] typeStrs = {
- "Java environment variable ",
- "Servlet context parameter ",
- "System environment variable "
+ "Java environment variable ", "Servlet context parameter ", "System environment variable "
};
String result = null;
diff --git a/geowebcache/core/src/main/java/org/geowebcache/ReinitializingBean.java b/geowebcache/core/src/main/java/org/geowebcache/ReinitializingBean.java
index ecaf9f7fba..e9f804a352 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/ReinitializingBean.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/ReinitializingBean.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/UncheckedGeoWebCacheException.java b/geowebcache/core/src/main/java/org/geowebcache/UncheckedGeoWebCacheException.java
index 68e6b4213a..2d6b670259 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/UncheckedGeoWebCacheException.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/UncheckedGeoWebCacheException.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Kevin Smith, Boundless, 2017
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/BaseConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/BaseConfiguration.java
index 1cb334990c..efe672a230 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/BaseConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/BaseConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -19,8 +18,7 @@
import org.springframework.beans.factory.InitializingBean;
/** Superinterface for GeoWebCache configuration beans, defining basic shared functionality */
-public interface BaseConfiguration
- extends InitializingBean, ReinitializingBean, GeoWebCacheExtensionPriority {
+public interface BaseConfiguration extends InitializingBean, ReinitializingBean, GeoWebCacheExtensionPriority {
/** Default priority for configuration beans. Lower values will have higher priority. */
public static final int BASE_PRIORITY = 50;
@@ -29,10 +27,9 @@ public interface BaseConfiguration
String getIdentifier();
/**
- * The location is a string identifying where this configuration is persisted
- * TileLayerConfiguration implementations may choose whatever form is appropriate to their
- * persistence mechanism and callers should not assume any particular format. In many but not
- * all cases this will be a URL or filesystem path.
+ * The location is a string identifying where this configuration is persisted TileLayerConfiguration implementations
+ * may choose whatever form is appropriate to their persistence mechanism and callers should not assume any
+ * particular format. In many but not all cases this will be a URL or filesystem path.
*
* @return Location string for this configuration
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreConfiguration.java
index 2afa9b6671..1a038f574d 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -25,18 +24,16 @@ public interface BlobStoreConfiguration extends BaseConfiguration {
/**
* Retrieves currently configured BlobStores.
*
- * @return A List of {@link BlobStoreInfo}s currently configured via backend configuration
- * providers.
+ * @return A List of {@link BlobStoreInfo}s currently configured via backend configuration providers.
*/
List getBlobStores();
/**
* Add and persist a {@link BlobStoreInfo} to this configuration.
*
- * @param info The {@link BlobStoreInfo} configuration to add and persist into the backend
- * configuration provider.
- * @throws IllegalArgumentException If the info is not a valid BlobStoreInfo, or can't be
- * added/persisted for some reason (for example, an info with the same name already exists).
+ * @param info The {@link BlobStoreInfo} configuration to add and persist into the backend configuration provider.
+ * @throws IllegalArgumentException If the info is not a valid BlobStoreInfo, or can't be added/persisted for some
+ * reason (for example, an info with the same name already exists).
*/
void addBlobStore(BlobStoreInfo info) throws IllegalArgumentException;
@@ -44,31 +41,27 @@ public interface BlobStoreConfiguration extends BaseConfiguration {
* Remove a {@link BlobStoreInfo} from this configuration.
*
* @param name String representation of the id of the BlobStore to remove. This
- * @throws NoSuchElementException If there is no BlobStore config identified by the provided
- * name.
- * @throws IllegalArgumentException If this configuration can't, for some reason, remove the
- * blob store identified by the supplied name (for example, the configuration is read-only).
+ * @throws NoSuchElementException If there is no BlobStore config identified by the provided name.
+ * @throws IllegalArgumentException If this configuration can't, for some reason, remove the blob store identified
+ * by the supplied name (for example, the configuration is read-only).
*/
void removeBlobStore(String name) throws NoSuchElementException, IllegalArgumentException;
/**
* Modifies a {@link BlobStoreInfo} in this configuration.
*
- * @param info The {@link BlobStoreInfo} that should be used to update an existing BlobStoreInfo
- * with the same name/id.
- * @throws NoSuchElementException If there is no BlobStore config identified by the provided
- * name.
- * @throws IllegalArgumentException If this configuration can't, for some reason, modify the
- * blob store identified by the supplied name (for example, the configuration is read-only).
+ * @param info The {@link BlobStoreInfo} that should be used to update an existing BlobStoreInfo with the same
+ * name/id.
+ * @throws NoSuchElementException If there is no BlobStore config identified by the provided name.
+ * @throws IllegalArgumentException If this configuration can't, for some reason, modify the blob store identified
+ * by the supplied name (for example, the configuration is read-only).
*/
- void modifyBlobStore(BlobStoreInfo info)
- throws NoSuchElementException, IllegalArgumentException;
+ void modifyBlobStore(BlobStoreInfo info) throws NoSuchElementException, IllegalArgumentException;
/**
* Retrieve a set of {@link BlobStoreInfo} names in this configuration.
*
- * @return A Set of names that can be used to identify each of the {@link BlobStoreInfo}s
- * currently configured.
+ * @return A Set of names that can be used to identify each of the {@link BlobStoreInfo}s currently configured.
*/
Set getBlobStoreNames();
@@ -83,8 +76,7 @@ void modifyBlobStore(BlobStoreInfo info)
* Retrieves a {@link BlobStoreInfo} from this configuration.
*
* @param name The name that identifies the desired {@link BlobStoreInfo}.
- * @return An Optional wrapping the desired {@link BlobStoreInfo}, or Empty if it does not
- * exist.
+ * @return An Optional wrapping the desired {@link BlobStoreInfo}, or Empty if it does not exist.
*/
Optional getBlobStore(String name);
@@ -92,8 +84,8 @@ void modifyBlobStore(BlobStoreInfo info)
* Indicates if this configuration can persist the supplied {@link BlobStoreInfo}.
*
* @param info a {@link BlobStoreInfo} to be persisted.
- * @return True if the supplied {@link BlobStoreInfo} can be persisted, false otherwise.
- * Implementations might return false if, for example, this configuration is read-only.
+ * @return True if the supplied {@link BlobStoreInfo} can be persisted, false otherwise. Implementations might
+ * return false if, for example, this configuration is read-only.
*/
boolean canSave(BlobStoreInfo info);
@@ -101,15 +93,12 @@ void modifyBlobStore(BlobStoreInfo info)
* Replaces a {@link BlobStoreInfo}'s name with a new name.
*
* @param oldName The name that identifies the {@link BlobStoreInfo} to be renamed.
- * @param newName The name that should replace the current name of the {@link BlobStoreInfo}
- * identified by oldName.
- * @throws NoSuchElementException If there is no BlobStore config identified by the provided
- * oldName.
- * @throws IllegalArgumentException If this configuration can't, for some reason, rename the
- * blob store identified by the supplied name (for example, newName is null or invalid).
+ * @param newName The name that should replace the current name of the {@link BlobStoreInfo} identified by oldName.
+ * @throws NoSuchElementException If there is no BlobStore config identified by the provided oldName.
+ * @throws IllegalArgumentException If this configuration can't, for some reason, rename the blob store identified
+ * by the supplied name (for example, newName is null or invalid).
*/
- void renameBlobStore(String oldName, String newName)
- throws NoSuchElementException, IllegalArgumentException;
+ void renameBlobStore(String oldName, String newName) throws NoSuchElementException, IllegalArgumentException;
/**
* Indicates if this configurations contains a {@link BlobStoreInfo) identified by a given name.
@@ -121,8 +110,6 @@ void renameBlobStore(String oldName, String newName)
/** Adds a {@link BlobStoreConfigurationListener} to this configuration. */
void addBlobStoreListener(BlobStoreConfigurationListener listener);
- /**
- * Removes a {@link BlobStoreConfigurationListener} from this configuration, if it is present.
- */
+ /** Removes a {@link BlobStoreConfigurationListener} from this configuration, if it is present. */
void removeBlobStoreListener(BlobStoreConfigurationListener listener);
}
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreConfigurationListener.java b/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreConfigurationListener.java
index abf7606c0f..8ae350cf5b 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreConfigurationListener.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreConfigurationListener.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -19,28 +18,26 @@
import org.geowebcache.storage.UnsuitableStorageException;
/**
- * Indicates a class should listen to {@link BlobStoreConfiguration} change events. Implementations
- * of this class are responsible for registering themselves via {@link
- * org.geowebcache.storage.BlobStoreAggregator}
+ * Indicates a class should listen to {@link BlobStoreConfiguration} change events. Implementations of this class are
+ * responsible for registering themselves via {@link org.geowebcache.storage.BlobStoreAggregator}
*/
public interface BlobStoreConfigurationListener {
/**
* @param newBlobStore The configuration for the blobstore that was added
- * @throws UnsuitableStorageException The blobstore is attempting to use an illegal storage
- * location and the change should be rolled back.
+ * @throws UnsuitableStorageException The blobstore is attempting to use an illegal storage location and the change
+ * should be rolled back.
*/
void handleAddBlobStore(BlobStoreInfo newBlobStore)
throws UnsuitableStorageException, GeoWebCacheException, IOException;
/** @param removedBlobStore The old configuration for the blobstore that was removed */
- void handleRemoveBlobStore(BlobStoreInfo removedBlobStore)
- throws GeoWebCacheException, IOException;
+ void handleRemoveBlobStore(BlobStoreInfo removedBlobStore) throws GeoWebCacheException, IOException;
/**
* @param modifiedBlobStore The new configuration for the blobstore
- * @throws UnsuitableStorageException The blobstore is attempting to use an illegal storage
- * location and the change should be rolled back.
+ * @throws UnsuitableStorageException The blobstore is attempting to use an illegal storage location and the change
+ * should be rolled back.
*/
void handleModifyBlobStore(BlobStoreInfo modifiedBlobStore)
throws UnsuitableStorageException, GeoWebCacheException, IOException;
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreInfo.java b/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreInfo.java
index a00946dc9a..972a4f3617 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreInfo.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/BlobStoreInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Gabriel Roldan, Boundless Spatial Inc, Copyright 2015
*/
@@ -24,17 +23,15 @@
/**
* Base class for configuration and factory of concrete {@link BlobStore} implementations.
*
- *
Each realization of {@link BlobStore} should have a matching {@link BlobStoreInfo} subclass
- * that acts both as configuration and {@link #createInstance(TileLayerDispatcher, LockProvider)}
- * factory}.
+ *
Each realization of {@link BlobStore} should have a matching {@link BlobStoreInfo} subclass that acts both as
+ * configuration and {@link #createInstance(TileLayerDispatcher, LockProvider)} factory}.
*
- *
Instances of this concrete subclasses of this class are meant to be obtained from {@link
- * BlobStoreAggregator#getBlobStores()}.
+ *
Instances of this concrete subclasses of this class are meant to be obtained from
+ * {@link BlobStoreAggregator#getBlobStores()}.
*
- *
When a blob store is defined in a module other than core, it is advisable that whatever {@code
- * XStream} configuration needed for correct parsing and encoding of the configuration object is
- * contributed through an {@link XMLConfigurationProvider}, such as class to xml element name
- * aliasing, attribute mappings, etc.
+ *
When a blob store is defined in a module other than core, it is advisable that whatever {@code XStream}
+ * configuration needed for correct parsing and encoding of the configuration object is contributed through an
+ * {@link XMLConfigurationProvider}, such as class to xml element name aliasing, attribute mappings, etc.
*
* @since 1.8
* @see FileBlobStoreInfo
@@ -67,10 +64,7 @@ public String getName() {
return name;
}
- /**
- * @return the unique identifier for the blob store; which {@link TileLayer#getBlobStoreId()}
- * refers to.
- */
+ /** @return the unique identifier for the blob store; which {@link TileLayer#getBlobStoreId()} refers to. */
public String getId() {
return getName();
}
@@ -108,18 +102,16 @@ public void setEnabled(boolean enabled) {
}
/**
- * @return whether the blob store defined by these settings is the default one (i.e. the one
- * used when {@code TileLayer#getBlobStoreId() == null}, and hence used to preserve
- * backwards compatibility).
+ * @return whether the blob store defined by these settings is the default one (i.e. the one used when
+ * {@code TileLayer#getBlobStoreId() == null}, and hence used to preserve backwards compatibility).
*/
public boolean isDefault() {
return _default;
}
/**
- * Sets whether the blob store defined by these settings is the default one (i.e. the one used
- * when {@code TileLayer#getBlobStoreId() == null}, and hence used to preserve backwards
- * compatibility).
+ * Sets whether the blob store defined by these settings is the default one (i.e. the one used when
+ * {@code TileLayer#getBlobStoreId() == null}, and hence used to preserve backwards compatibility).
*
* @param def True if this BlobStoreInfo should be the default, false otherwise.
*/
@@ -140,15 +132,13 @@ public Object clone() {
}
/**
- * Factory method for this class of blobstore, configured as per this configuration object
- * properties.
+ * Factory method for this class of blobstore, configured as per this configuration object properties.
*
*
May only be called if {@link #isEnabled() == true}.
*
* @return A BlobStore implementation.
* @throws StorageException if the blob store can't be created with this configuration settings
- * @throws IllegalStateException if {@link #isEnabled() isEnabled() == false} or {@link #getId()
- * getId() == null}
+ * @throws IllegalStateException if {@link #isEnabled() isEnabled() == false} or {@link #getId() getId() == null}
*/
public abstract BlobStore createInstance(TileLayerDispatcher layers, LockProvider lockProvider)
throws StorageException;
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationAggregator.java b/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationAggregator.java
index 2a21a296d0..7c78ceb609 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationAggregator.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationAggregator.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationException.java b/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationException.java
index ffb31f4799..7750cdd5eb 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationException.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationException.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, The Open Planning Project, Copyright 2008
*/
@@ -17,8 +16,8 @@
import org.geowebcache.GeoWebCacheException;
/**
- * An exception which indicates there was an error accessing a {@link BaseConfiguration
- * configuration} or {@link Info configuration object}.
+ * An exception which indicates there was an error accessing a {@link BaseConfiguration configuration} or {@link Info
+ * configuration object}.
*/
public class ConfigurationException extends GeoWebCacheException {
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationPersistenceException.java b/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationPersistenceException.java
index 12b4c3dd1c..4a6c75d6bd 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationPersistenceException.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationPersistenceException.java
@@ -1,22 +1,21 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
package org.geowebcache.config;
/**
- * An exception which indicates there was an error persisting a {@link Info configuration object} to
- * a {@link BaseConfiguration configuration}.
+ * An exception which indicates there was an error persisting a {@link Info configuration object} to a
+ * {@link BaseConfiguration configuration}.
*/
public class ConfigurationPersistenceException extends RuntimeException {
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationResourceProvider.java b/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationResourceProvider.java
index fb00152ff4..eeae21aa7c 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationResourceProvider.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/ConfigurationResourceProvider.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Niels Charlier Copyright 2015
*/
@@ -41,11 +40,11 @@ public interface ConfigurationResourceProvider {
public String getLocation() throws IOException;
/**
- * Allows to set the location of the template file to create geowebcache.xml from when it's not
- * found in the cache directory.
+ * Allows to set the location of the template file to create geowebcache.xml from when it's not found in the cache
+ * directory.
*
- * @param templateLocation location of the template geowebcache.xml file, must be a classpath
- * location. If not set defaults to /geowebcache.xml
+ * @param templateLocation location of the template geowebcache.xml file, must be a classpath location. If not set
+ * defaults to /geowebcache.xml
*/
public void setTemplate(String templateLocation);
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/ContextualConfigurationProvider.java b/geowebcache/core/src/main/java/org/geowebcache/config/ContextualConfigurationProvider.java
index a1db13d3b7..89f05d82d1 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/ContextualConfigurationProvider.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/ContextualConfigurationProvider.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/DefaultGridsets.java b/geowebcache/core/src/main/java/org/geowebcache/config/DefaultGridsets.java
index 905fb0f4f9..ab4c7366a8 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/DefaultGridsets.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/DefaultGridsets.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -77,10 +76,10 @@ public GridSet worldMercatorWGS84Quad() {
/**
* Construct the default gridsets bean
*
- * @param useEPSG900913 Whether or not to use "EPSG:900913" as the name of the default web
- * mercator instead if "EPSG:3857". Only used if useGWC11xNames is true
- * @param useGWC11xNames Whether to use the legacy GeoWebCache 1.1.x naming scheme (EPSG codes)
- * for the default gridset names. Otherwise
+ * @param useEPSG900913 Whether or not to use "EPSG:900913" as the name of the default web mercator instead if
+ * "EPSG:3857". Only used if useGWC11xNames is true
+ * @param useGWC11xNames Whether to use the legacy GeoWebCache 1.1.x naming scheme (EPSG codes) for the default
+ * gridset names. Otherwise
*/
public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
@@ -96,86 +95,76 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
}
}
- WORLD_EPSG4326 =
- GridSetFactory.createGridSet(
- unprojectedName,
- SRS.getEPSG4326(),
- BoundingBox.WORLD4326,
- false,
- GridSetFactory.DEFAULT_LEVELS,
- null,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- 256,
- 256,
- true);
- WORLD_EPSG4326.setDescription(
- "A default WGS84 tile matrix set where the first zoom level "
- + "covers the world with two tiles on the horizontal axis and one tile "
- + "over the vertical axis and each subsequent zoom level is calculated by half "
- + "the resolution of its previous one. Tiles are 256px wide.");
+ WORLD_EPSG4326 = GridSetFactory.createGridSet(
+ unprojectedName,
+ SRS.getEPSG4326(),
+ BoundingBox.WORLD4326,
+ false,
+ GridSetFactory.DEFAULT_LEVELS,
+ null,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ 256,
+ 256,
+ true);
+ WORLD_EPSG4326.setDescription("A default WGS84 tile matrix set where the first zoom level "
+ + "covers the world with two tiles on the horizontal axis and one tile "
+ + "over the vertical axis and each subsequent zoom level is calculated by half "
+ + "the resolution of its previous one. Tiles are 256px wide.");
addInternal(WORLD_EPSG4326);
- WORLD_EPSG4326x2 =
- GridSetFactory.createGridSet(
- unprojectedName + "x2",
- SRS.getEPSG4326(),
- BoundingBox.WORLD4326,
- false,
- GridSetFactory.DEFAULT_LEVELS,
- null,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- 512,
- 512,
- true);
- WORLD_EPSG4326x2.setDescription(
- "A default WGS84 tile matrix set where the first zoom level "
- + "covers the world with two tiles on the horizontal axis and one tile "
- + "over the vertical axis and each subsequent zoom level is calculated by half "
- + "the resolution of its previous one. Tiles are 512px wide.");
+ WORLD_EPSG4326x2 = GridSetFactory.createGridSet(
+ unprojectedName + "x2",
+ SRS.getEPSG4326(),
+ BoundingBox.WORLD4326,
+ false,
+ GridSetFactory.DEFAULT_LEVELS,
+ null,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ 512,
+ 512,
+ true);
+ WORLD_EPSG4326x2.setDescription("A default WGS84 tile matrix set where the first zoom level "
+ + "covers the world with two tiles on the horizontal axis and one tile "
+ + "over the vertical axis and each subsequent zoom level is calculated by half "
+ + "the resolution of its previous one. Tiles are 512px wide.");
addInternal(WORLD_EPSG4326x2);
final SRS googleMapsCompatibleSRS = useEPSG900913 ? SRS.getEPSG900913() : SRS.getEPSG3857();
- log.fine(
- "Adding "
- + googleMapsCompatibleSRS
- + " grid set for Spherical Mercator / GoogleMapsCompatible");
-
- WORLD_EPSG3857 =
- GridSetFactory.createGridSet(
- mercatorName,
- googleMapsCompatibleSRS,
- BoundingBox.WORLD3857,
- false,
- commonPractice900913Resolutions(),
- null,
- 1.0D,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- null,
- 256,
- 256,
- false);
- WORLD_EPSG3857.setDescription(
- "This well-known scale set has been defined to be compatible with Google Maps and"
- + " Microsoft Live Map projections and zoom levels. Level 0 allows representing the whole "
- + "world in a single 256x256 pixels. The next level represents the whole world in 2x2 tiles "
- + "of 256x256 pixels and so on in powers of 2. Scale denominator is only accurate near the equator.");
+ log.fine("Adding " + googleMapsCompatibleSRS + " grid set for Spherical Mercator / GoogleMapsCompatible");
+
+ WORLD_EPSG3857 = GridSetFactory.createGridSet(
+ mercatorName,
+ googleMapsCompatibleSRS,
+ BoundingBox.WORLD3857,
+ false,
+ commonPractice900913Resolutions(),
+ null,
+ 1.0D,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ null,
+ 256,
+ 256,
+ false);
+ WORLD_EPSG3857.setDescription("This well-known scale set has been defined to be compatible with Google Maps and"
+ + " Microsoft Live Map projections and zoom levels. Level 0 allows representing the whole "
+ + "world in a single 256x256 pixels. The next level represents the whole world in 2x2 tiles "
+ + "of 256x256 pixels and so on in powers of 2. Scale denominator is only accurate near the equator.");
addInternal(WORLD_EPSG3857);
- WORLD_EPSG3857x2 =
- GridSetFactory.createGridSet(
- mercatorName + "x2",
- googleMapsCompatibleSRS,
- BoundingBox.WORLD3857,
- false,
- halveResolutions(commonPractice900913Resolutions()),
- null,
- 1.0D,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- null,
- 512,
- 512,
- false);
+ WORLD_EPSG3857x2 = GridSetFactory.createGridSet(
+ mercatorName + "x2",
+ googleMapsCompatibleSRS,
+ BoundingBox.WORLD3857,
+ false,
+ halveResolutions(commonPractice900913Resolutions()),
+ null,
+ 1.0D,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ null,
+ 512,
+ 512,
+ false);
WORLD_EPSG3857x2.setDescription(
"This well-known scale set has been defined to be compatible with Google Maps and"
+ " Microsoft Live Map projections and zoom levels. Level 0 allows representing the whole "
@@ -184,65 +173,60 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
addInternal(WORLD_EPSG3857x2);
log.fine("Adding GlobalCRS84Pixel");
- GridSet GlobalCRS84Pixel =
- GridSetFactory.createGridSet(
- "GlobalCRS84Pixel",
- SRS.getEPSG4326(),
- BoundingBox.WORLD4326,
- true,
- scalesCRS84PixelResolutions(),
- null,
- null,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- null,
- 256,
- 256,
- true);
- GlobalCRS84Pixel.setDescription(
- "This well-known scale set has been defined for global cartographic products. "
- + "Rounded pixel sizes have been chosen for intuitive cartographic representation of raster data. "
- + "Some values have been chosen to coincide with original pixel size of commonly used global"
- + "products like STRM (1\" and 3\"), GTOPO (30\") or ETOPO (2' and 5'). Scale denominator"
- + "and approximated pixel size in meters are only accurate near the equator.");
+ GridSet GlobalCRS84Pixel = GridSetFactory.createGridSet(
+ "GlobalCRS84Pixel",
+ SRS.getEPSG4326(),
+ BoundingBox.WORLD4326,
+ true,
+ scalesCRS84PixelResolutions(),
+ null,
+ null,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ null,
+ 256,
+ 256,
+ true);
+ GlobalCRS84Pixel.setDescription("This well-known scale set has been defined for global cartographic products. "
+ + "Rounded pixel sizes have been chosen for intuitive cartographic representation of raster data. "
+ + "Some values have been chosen to coincide with original pixel size of commonly used global"
+ + "products like STRM (1\" and 3\"), GTOPO (30\") or ETOPO (2' and 5'). Scale denominator"
+ + "and approximated pixel size in meters are only accurate near the equator.");
addInternal(GlobalCRS84Pixel);
log.fine("Adding GlobalCRS84Scale");
- GridSet GlobalCRS84Scale =
- GridSetFactory.createGridSet(
- "GlobalCRS84Scale",
- SRS.getEPSG4326(),
- BoundingBox.WORLD4326,
- true,
- null,
- scalesCRS84ScaleDenominators(),
- null,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- null,
- 256,
- 256,
- true);
- GlobalCRS84Scale.setDescription(
- "This well-known scale set has been defined for global cartographic products. "
- + "Rounded scales have been chosen for intuitive cartographic representation of vector data. "
- + "Scale denominator is only accurate near the equator.");
+ GridSet GlobalCRS84Scale = GridSetFactory.createGridSet(
+ "GlobalCRS84Scale",
+ SRS.getEPSG4326(),
+ BoundingBox.WORLD4326,
+ true,
+ null,
+ scalesCRS84ScaleDenominators(),
+ null,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ null,
+ 256,
+ 256,
+ true);
+ GlobalCRS84Scale.setDescription("This well-known scale set has been defined for global cartographic products. "
+ + "Rounded scales have been chosen for intuitive cartographic representation of vector data. "
+ + "Scale denominator is only accurate near the equator.");
addInternal(GlobalCRS84Scale);
log.fine("Adding GoogleCRS84Quad");
- GridSet GoogleCRS84Quad =
- GridSetFactory.createGridSet(
- "GoogleCRS84Quad",
- SRS.getEPSG4326(),
- BoundingBox.WORLD4326,
- true,
- null,
- scalesCRS84QuadScaleDenominators(),
- null,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- null,
- 256,
- 256,
- true);
+ GridSet GoogleCRS84Quad = GridSetFactory.createGridSet(
+ "GoogleCRS84Quad",
+ SRS.getEPSG4326(),
+ BoundingBox.WORLD4326,
+ true,
+ null,
+ scalesCRS84QuadScaleDenominators(),
+ null,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ null,
+ 256,
+ 256,
+ true);
GoogleCRS84Quad.setDescription(
"This well-known scale set has been defined to allow quadtree "
+ "pyramids in CRS84. Level 0 allows representing the whole world "
@@ -253,49 +237,48 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
addInternal(GoogleCRS84Quad);
log.fine("Adding OGC TMS WebMercatorQuad");
- WEB_MERCATOR_QUAD =
- GridSetFactory.createGridSet(
- "WebMercatorQuad",
- SRS.getEPSG3857(),
- BoundingBox.WORLD3857,
- true,
- null,
- new double[] {
- 559082264.028717,
- 279541132.014358,
- 139770566.007179,
- 69885283.0035897,
- 34942641.5017948,
- 17471320.7508974,
- 8735660.37544871,
- 4367830.18772435,
- 2183915.09386217,
- 1091957.54693108,
- 545978.773465544,
- 272989.386732772,
- 136494.693366386,
- 68247.346683193,
- 34123.6733415964,
- 17061.8366707982,
- 8530.91833539913,
- 4265.45916769956,
- 2132.72958384978,
- 1066.36479192489,
- 533.182395962445,
- 266.591197981222,
- 133.295598990611,
- 66.6477994953056,
- 33.3238997476528
- },
- 1d,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- new String[] {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"
- },
- 256,
- 256,
- true);
+ WEB_MERCATOR_QUAD = GridSetFactory.createGridSet(
+ "WebMercatorQuad",
+ SRS.getEPSG3857(),
+ BoundingBox.WORLD3857,
+ true,
+ null,
+ new double[] {
+ 559082264.028717,
+ 279541132.014358,
+ 139770566.007179,
+ 69885283.0035897,
+ 34942641.5017948,
+ 17471320.7508974,
+ 8735660.37544871,
+ 4367830.18772435,
+ 2183915.09386217,
+ 1091957.54693108,
+ 545978.773465544,
+ 272989.386732772,
+ 136494.693366386,
+ 68247.346683193,
+ 34123.6733415964,
+ 17061.8366707982,
+ 8530.91833539913,
+ 4265.45916769956,
+ 2132.72958384978,
+ 1066.36479192489,
+ 533.182395962445,
+ 266.591197981222,
+ 133.295598990611,
+ 66.6477994953056,
+ 33.3238997476528
+ },
+ 1d,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ new String[] {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
+ "18", "19", "20", "21", "22", "23", "24"
+ },
+ 256,
+ 256,
+ true);
// copied from the OGC TMS spec
WEB_MERCATOR_QUAD.setDescription(
"This tile matrix set is the most used tile matrix set in the mass market: for example, by Google Maps, Microsoft Bing Maps and Open Street Map tiles. Nevertheless, it has been long criticized because it is a based on a spherical Mercator instead of an ellipsoid. The use of WebMercatorQuad should be limited to visualization. Any additional use (including distance measurements, routing etc.) needs to use the Mercator spherical expressions to transform the coordinate to an appropriate CRS first. The risks caused by imprecision in the use of Web Mercator is also emphasized by the US National Geospatial Agency (NGA). NGA has issued an Advisory Notice on web Mercator (http://earth-info.nga.mil/GandG/wgs84/web_mercator/index.html) that says that “it may cause geo-location / geo-coordinate errors up to 40,000 meters. This erroneous geospatial positioning information poses an unacceptable risk to global safety of navigation activities, and department of defense, intelligence community, and allied partner systems, missions, and operations that require accurate and precise positioning and navigation information.” The use of WorldMercatorWGS84Quad is recommended.");
@@ -303,42 +286,41 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
addx2Gridset(WEB_MERCATOR_QUAD);
log.fine("Adding OGC TMS WorldCRS84Quad");
- WORLD_CRS84_QUAD =
- GridSetFactory.createGridSet(
- "WorldCRS84Quad",
- SRS.getEPSG4326(),
- BoundingBox.WORLD4326,
- true,
- null,
- new double[] {
- 279541132.0143589,
- 139770566.0071794,
- 69885283.00358972,
- 34942641.50179486,
- 17471320.75089743,
- 8735660.375448715,
- 4367830.187724357,
- 2183915.093862179,
- 1091957.546931089,
- 545978.7734655447,
- 272989.3867327723,
- 136494.6933663862,
- 68247.34668319309,
- 34123.67334159654,
- 17061.83667079827,
- 8530.918335399136,
- 4265.459167699568,
- 2132.729583849784,
- },
- null,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- new String[] {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18"
- },
- 256,
- 256,
- true);
+ WORLD_CRS84_QUAD = GridSetFactory.createGridSet(
+ "WorldCRS84Quad",
+ SRS.getEPSG4326(),
+ BoundingBox.WORLD4326,
+ true,
+ null,
+ new double[] {
+ 279541132.0143589,
+ 139770566.0071794,
+ 69885283.00358972,
+ 34942641.50179486,
+ 17471320.75089743,
+ 8735660.375448715,
+ 4367830.187724357,
+ 2183915.093862179,
+ 1091957.546931089,
+ 545978.7734655447,
+ 272989.3867327723,
+ 136494.6933663862,
+ 68247.34668319309,
+ 34123.67334159654,
+ 17061.83667079827,
+ 8530.918335399136,
+ 4265.459167699568,
+ 2132.729583849784,
+ },
+ null,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ new String[] {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
+ "18"
+ },
+ 256,
+ 256,
+ true);
// copied from the OGC TMS spec
WORLD_CRS84_QUAD.setDescription(
"This Tile Matrix Set defines tiles in the Equirectangular Plate Carrée projection in the CRS84 CRS for the whole world.");
@@ -346,53 +328,48 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
addx2Gridset(WORLD_CRS84_QUAD);
log.fine("Adding OGC TMS WorldMercatorWGS84Quad");
- WORLD_MERCATOR_WGS84_QUAD =
- GridSetFactory.createGridSet(
- "WorldMercatorWGS84Quad",
- SRS.getSRS(3395),
- new BoundingBox(
- -20037508.3427892,
- -20037508.3427892,
- 20037508.3427892,
- 20037508.3427892),
- true,
- null,
- new double[] {
- 559082264.028717,
- 279541132.014358,
- 139770566.007179,
- 69885283.0035897,
- 34942641.5017948,
- 17471320.7508974,
- 8735660.37544871,
- 4367830.18772435,
- 2183915.09386217,
- 1091957.54693108,
- 545978.773465544,
- 272989.386732772,
- 136494.693366386,
- 68247.346683193,
- 34123.6733415964,
- 17061.8366707982,
- 8530.91833539913,
- 4265.45916769956,
- 2132.72958384978,
- 1066.36479192489,
- 533.182395962445,
- 266.591197981222,
- 133.295598990611,
- 66.6477994953056,
- 33.3238997476528,
- },
- 1d,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- new String[] {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"
- },
- 256,
- 256,
- true);
+ WORLD_MERCATOR_WGS84_QUAD = GridSetFactory.createGridSet(
+ "WorldMercatorWGS84Quad",
+ SRS.getSRS(3395),
+ new BoundingBox(-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892),
+ true,
+ null,
+ new double[] {
+ 559082264.028717,
+ 279541132.014358,
+ 139770566.007179,
+ 69885283.0035897,
+ 34942641.5017948,
+ 17471320.7508974,
+ 8735660.37544871,
+ 4367830.18772435,
+ 2183915.09386217,
+ 1091957.54693108,
+ 545978.773465544,
+ 272989.386732772,
+ 136494.693366386,
+ 68247.346683193,
+ 34123.6733415964,
+ 17061.8366707982,
+ 8530.91833539913,
+ 4265.45916769956,
+ 2132.72958384978,
+ 1066.36479192489,
+ 533.182395962445,
+ 266.591197981222,
+ 133.295598990611,
+ 66.6477994953056,
+ 33.3238997476528,
+ },
+ 1d,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ new String[] {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
+ "18", "19", "20", "21", "22", "23", "24"
+ },
+ 256,
+ 256,
+ true);
// not from the spec, it does not have one
WORLD_MERCATOR_WGS84_QUAD.setDescription(
"This Tile Matrix Set defines tiles in the Mercator projection in the WGS84 CRS for the whole world.");
@@ -430,32 +407,25 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
// the 60 UTM zones from the OGC TMS specification
for (int i = 1; i <= 60; i++) {
String id = "UTM" + (i < 10 ? "0" : "") + i + "WGS84Quad";
- GridSet utmGridset =
- GridSetFactory.createGridSet(
- id,
- SRS.getSRS(32600 + i),
- new BoundingBox(
- -9501965.72931276,
- -20003931.4586255,
- 10501965.7293128,
- 20003931.4586255),
- true,
- null,
- UTM_SCALES,
- 1d,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- new String[] {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23",
- "24"
- },
- 256,
- 256,
- true);
+ GridSet utmGridset = GridSetFactory.createGridSet(
+ id,
+ SRS.getSRS(32600 + i),
+ new BoundingBox(-9501965.72931276, -20003931.4586255, 10501965.7293128, 20003931.4586255),
+ true,
+ null,
+ UTM_SCALES,
+ 1d,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ new String[] {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
+ "17", "18", "19", "20", "21", "22", "23", "24"
+ },
+ 256,
+ 256,
+ true);
// not from the spec, it does not have one
utmGridset.setDescription(
- "This Tile Matrix Set defines tiles in the Universal Transverse Mercator, zone "
- + i);
+ "This Tile Matrix Set defines tiles in the Universal Transverse Mercator, zone " + i);
addInternal(utmGridset);
addx2Gridset(utmGridset);
}
@@ -489,26 +459,23 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
54.68446545,
27.34223273
};
- BoundingBox upsBounds =
- new BoundingBox(
- -14440759.350252, -14440759.350252, 18440759.350252, 18440759.350252);
- final GridSet upsArctic =
- GridSetFactory.createGridSet(
- "UPSArcticWGS84Quad",
- SRS.getSRS(5041),
- upsBounds,
- true,
- null,
- upsScales,
- 1d,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- new String[] {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"
- },
- 256,
- 256,
- true);
+ BoundingBox upsBounds = new BoundingBox(-14440759.350252, -14440759.350252, 18440759.350252, 18440759.350252);
+ final GridSet upsArctic = GridSetFactory.createGridSet(
+ "UPSArcticWGS84Quad",
+ SRS.getSRS(5041),
+ upsBounds,
+ true,
+ null,
+ upsScales,
+ 1d,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ new String[] {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
+ "18", "19", "20", "21", "22", "23", "24"
+ },
+ 256,
+ 256,
+ true);
// not from the spec, it does not have one
upsArctic.setDescription(
"This Tile Matrix Set defines tiles in the Universal Polar Stereographics for the arctic");
@@ -517,23 +484,22 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
// UPS antarctic
log.fine("Adding OGC TMS UPSAntarcticWGS84Quad");
- final GridSet upsAntarctic =
- GridSetFactory.createGridSet(
- "UPSAntarcticWGS84Quad",
- SRS.getSRS(5042),
- upsBounds,
- true,
- null,
- upsScales,
- 1d,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- new String[] {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"
- },
- 256,
- 256,
- true);
+ final GridSet upsAntarctic = GridSetFactory.createGridSet(
+ "UPSAntarcticWGS84Quad",
+ SRS.getSRS(5042),
+ upsBounds,
+ true,
+ null,
+ upsScales,
+ 1d,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ new String[] {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
+ "18", "19", "20", "21", "22", "23", "24"
+ },
+ 256,
+ 256,
+ true);
// not from the spec, it does not have one
upsAntarctic.setDescription(
"This Tile Matrix Set defines tiles in the Universal Polar Stereographics for the Antarctic");
@@ -541,95 +507,85 @@ public DefaultGridsets(boolean useEPSG900913, boolean useGWC11xNames) {
addx2Gridset(upsAntarctic);
log.fine("Adding OGC TMS EuropeanETRS89_LAEAQuad");
- GridSet euETRS89LaeaQuad =
- GridSetFactory.createGridSet(
- "EuropeanETRS89_LAEAQuad",
- SRS.getSRS(3035),
- new BoundingBox(2000000.0, 1000000.0, 6500000, 5500000.0),
- true,
- null,
- new double[] {
- 62779017.857142866,
- 31389508.928571433,
- 15694754.464285716,
- 7847377.232142858,
- 3923688.616071429,
- 1961844.3080357146,
- 980922.1540178573,
- 490461.07700892864,
- 245230.53850446432,
- 122615.26925223216,
- 61307.63462611608,
- 30653.81731305804,
- 15326.90865652902,
- 7663.45432826451,
- 3831.727164132255,
- 1915.8635820661275,
- },
- 1d,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- new String[] {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15"
- },
- 256,
- 256,
- true);
+ GridSet euETRS89LaeaQuad = GridSetFactory.createGridSet(
+ "EuropeanETRS89_LAEAQuad",
+ SRS.getSRS(3035),
+ new BoundingBox(2000000.0, 1000000.0, 6500000, 5500000.0),
+ true,
+ null,
+ new double[] {
+ 62779017.857142866,
+ 31389508.928571433,
+ 15694754.464285716,
+ 7847377.232142858,
+ 3923688.616071429,
+ 1961844.3080357146,
+ 980922.1540178573,
+ 490461.07700892864,
+ 245230.53850446432,
+ 122615.26925223216,
+ 61307.63462611608,
+ 30653.81731305804,
+ 15326.90865652902,
+ 7663.45432826451,
+ 3831.727164132255,
+ 1915.8635820661275,
+ },
+ 1d,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"},
+ 256,
+ 256,
+ true);
// not from the spec, it does not have one
euETRS89LaeaQuad.setDescription("Lambert Azimuthal Equal Area ETRS89 for Europe");
addInternal(euETRS89LaeaQuad);
addx2Gridset(euETRS89LaeaQuad);
log.fine("Adding OGC TMS CanadianNAD83_LCC");
- GridSet canadianNAD83Lcc =
- GridSetFactory.createGridSet(
- "CanadianNAD83_LCC",
- SRS.getSRS(3978),
- new BoundingBox(
- -7786476.885838887,
- -5153821.09213678,
- 7148753.233541353,
- 7928343.534071138),
- true,
- null,
- new double[] {
- 137016643.080905,
- 80320101.1163925,
- 47247118.3037603,
- 28348270.9822562,
- 16536491.4063161,
- 9449423.66075207,
- 5669654.19645125,
- 3307298.28126323,
- 1889884.73215041,
- 1133930.83929025,
- 661459.656252643,
- 396875.793751586,
- 236235.591518802,
- 137016.643080905,
- 80320.1011163925,
- 47247.1183037603,
- 28348.2709822562,
- 16536.4914063161,
- 9449.42366075207,
- 5669.65419645125,
- 3307.29828126323,
- 1889.88473215041,
- 1133.93083929025,
- 661.459656252643,
- 396.875793751586,
- 236.235591518802
- },
- 1d,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- new String[] {
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24",
- "25"
- },
- 256,
- 256,
- true);
+ GridSet canadianNAD83Lcc = GridSetFactory.createGridSet(
+ "CanadianNAD83_LCC",
+ SRS.getSRS(3978),
+ new BoundingBox(-7786476.885838887, -5153821.09213678, 7148753.233541353, 7928343.534071138),
+ true,
+ null,
+ new double[] {
+ 137016643.080905,
+ 80320101.1163925,
+ 47247118.3037603,
+ 28348270.9822562,
+ 16536491.4063161,
+ 9449423.66075207,
+ 5669654.19645125,
+ 3307298.28126323,
+ 1889884.73215041,
+ 1133930.83929025,
+ 661459.656252643,
+ 396875.793751586,
+ 236235.591518802,
+ 137016.643080905,
+ 80320.1011163925,
+ 47247.1183037603,
+ 28348.2709822562,
+ 16536.4914063161,
+ 9449.42366075207,
+ 5669.65419645125,
+ 3307.29828126323,
+ 1889.88473215041,
+ 1133.93083929025,
+ 661.459656252643,
+ 396.875793751586,
+ 236.235591518802
+ },
+ 1d,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ new String[] {
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
+ "18", "19", "20", "21", "22", "23", "24", "25"
+ },
+ 256,
+ 256,
+ true);
// not from the spec, it does not have one
canadianNAD83Lcc.setDescription("Lambert Conformal Conic for Canada");
addInternal(canadianNAD83Lcc);
@@ -648,20 +604,19 @@ private void addx2Gridset(GridSet base) {
scaleNames[i] = base.getGrid(i).getName();
}
- GridSet x2 =
- GridSetFactory.createGridSet(
- base.getName() + "x2",
- base.getSrs(),
- base.getOriginalExtent(),
- base.isTopLeftAligned(),
- null,
- scales,
- base.getMetersPerUnit(),
- base.getPixelSize(),
- scaleNames,
- 512,
- 512,
- base.isyCoordinateFirst());
+ GridSet x2 = GridSetFactory.createGridSet(
+ base.getName() + "x2",
+ base.getSrs(),
+ base.getOriginalExtent(),
+ base.isTopLeftAligned(),
+ null,
+ scales,
+ base.getMetersPerUnit(),
+ base.getPixelSize(),
+ scaleNames,
+ 512,
+ 512,
+ base.isyCoordinateFirst());
addInternal(x2);
}
@@ -777,8 +732,8 @@ private double[] scalesCRS84ScaleDenominators() {
//
// return scalesCRS84Pixel;
double[] scalesCRS84Pixel = {
- 500E6, 250E6, 100E6, 50E6, 25E6, 10E6, 5E6, 2.5E6, 1E6, 500E3, 250E3, 100E3, 50E3, 25E3,
- 10E3, 5E3, 2.5E3, 1000, 500, 250, 100
+ 500E6, 250E6, 100E6, 50E6, 25E6, 10E6, 5E6, 2.5E6, 1E6, 500E3, 250E3, 100E3, 50E3, 25E3, 10E3, 5E3, 2.5E3,
+ 1000, 500, 250, 100
};
return scalesCRS84Pixel;
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/DefaultingConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/DefaultingConfiguration.java
index 995211cd7d..e0bd2c74cd 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/DefaultingConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/DefaultingConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -20,9 +19,8 @@
public interface DefaultingConfiguration extends BaseConfiguration {
/**
- * TileLayerConfiguration objects lacking their own defaults can delegate to this. Should set
- * values in the default geowebcache.xml to the TileLayer configuration, and fall back on
- * implemented default values if missing.
+ * TileLayerConfiguration objects lacking their own defaults can delegate to this. Should set values in the default
+ * geowebcache.xml to the TileLayer configuration, and fall back on implemented default values if missing.
*/
void setDefaultValues(TileLayer layer);
}
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/FileBlobStoreInfo.java b/geowebcache/core/src/main/java/org/geowebcache/config/FileBlobStoreInfo.java
index 8f89e4b45d..44f614eda5 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/FileBlobStoreInfo.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/FileBlobStoreInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Gabriel Roldan, Boundless Spatial Inc, Copyright 2015
*/
@@ -74,25 +73,21 @@ public void setBaseDirectory(String baseDirectory) {
}
/**
- * A positive integer representing the file system block size (usually 4096, 8292, or 16384,
- * depending on the file system ) of the
- * file system where the {@link #getBaseDirectory() base directory} resides.
+ * A positive integer representing the file system block size (usually 4096, 8292, or 16384, depending on the file system ) of the file system where the
+ * {@link #getBaseDirectory() base directory} resides.
*
- *
This value is used to pad the size of tile files to the actual size of the file on disk
- * before notifying {@link BlobStoreListener#tileDeleted}, {@link BlobStoreListener#tileStored},
- * or {@link BlobStoreListener#tileUpdated}.
+ *
This value is used to pad the size of tile files to the actual size of the file on disk before notifying
+ * {@link BlobStoreListener#tileDeleted}, {@link BlobStoreListener#tileStored}, or
+ * {@link BlobStoreListener#tileUpdated}.
*
- * @return the block size of the file system where the {@link #getBaseDirectory() base
- * directory} resides.
+ * @return the block size of the file system where the {@link #getBaseDirectory() base directory} resides.
*/
public int getFileSystemBlockSize() {
return fileSystemBlockSize;
}
- /**
- * Sets the block size of the file system where the {@link #getBaseDirectory() base directory}
- * resides.
- */
+ /** Sets the block size of the file system where the {@link #getBaseDirectory() base directory} resides. */
public void setFileSystemBlockSize(int fileSystemBlockSize) {
this.fileSystemBlockSize = fileSystemBlockSize;
}
@@ -123,33 +118,22 @@ public String toString() {
/** @see BlobStoreInfo#createInstance(TileLayerDispatcher, LockProvider) */
@Override
- public BlobStore createInstance(TileLayerDispatcher layers, LockProvider lockProvider)
- throws StorageException {
+ public BlobStore createInstance(TileLayerDispatcher layers, LockProvider lockProvider) throws StorageException {
checkState(getName() != null, "id not set");
- checkState(
- isEnabled(),
- "Can't call FileBlobStoreConfig.createInstance() is blob store is not enabled");
+ checkState(isEnabled(), "Can't call FileBlobStoreConfig.createInstance() is blob store is not enabled");
checkState(baseDirectory != null, "baseDirectory not provided");
- checkState(
- fileSystemBlockSize >= 0,
- "fileSystemBlockSize must be a positive integer: %s",
- fileSystemBlockSize);
+ checkState(fileSystemBlockSize >= 0, "fileSystemBlockSize must be a positive integer: %s", fileSystemBlockSize);
FileBlobStore fileBlobStore;
if (pathGeneratorType == null || pathGeneratorType == PathGeneratorType.DEFAULT) {
- fileBlobStore =
- new FileBlobStore(baseDirectory, new DefaultFilePathGenerator(baseDirectory));
+ fileBlobStore = new FileBlobStore(baseDirectory, new DefaultFilePathGenerator(baseDirectory));
} else if (pathGeneratorType == PathGeneratorType.TMS) {
- fileBlobStore =
- new FileBlobStore(
- baseDirectory,
- new XYZFilePathGenerator(
- baseDirectory, layers, XYZFilePathGenerator.Convention.TMS));
+ fileBlobStore = new FileBlobStore(
+ baseDirectory,
+ new XYZFilePathGenerator(baseDirectory, layers, XYZFilePathGenerator.Convention.TMS));
} else {
- fileBlobStore =
- new FileBlobStore(
- baseDirectory,
- new XYZFilePathGenerator(
- baseDirectory, layers, XYZFilePathGenerator.Convention.XYZ));
+ fileBlobStore = new FileBlobStore(
+ baseDirectory,
+ new XYZFilePathGenerator(baseDirectory, layers, XYZFilePathGenerator.Convention.XYZ));
}
if (fileSystemBlockSize > 0) {
fileBlobStore.setBlockSize(fileSystemBlockSize);
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/GeoWebCacheConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/GeoWebCacheConfiguration.java
index 872d4724db..1a4bcaf556 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/GeoWebCacheConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/GeoWebCacheConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, The Open Planning Project, Copyright 2009
*/
@@ -91,8 +90,7 @@ private Object readResolve() {
xmlns = "http://geowebcache.org/schema/" + getVersion();
- xsi_schemaLocation =
- xmlns + " http://geowebcache.org/schema/" + getVersion() + "/geowebcache.xsd";
+ xsi_schemaLocation = xmlns + " http://geowebcache.org/schema/" + getVersion() + "/geowebcache.xsd";
if (layers == null) {
layers = new ArrayList<>();
@@ -117,8 +115,7 @@ public String getVersion() {
public void setVersion(String version) {
this.version = version;
xmlns = "http://geowebcache.org/schema/" + version;
- xsi_schemaLocation =
- xmlns + " http://geowebcache.org/schema/" + version + "/geowebcache.xsd";
+ xsi_schemaLocation = xmlns + " http://geowebcache.org/schema/" + version + "/geowebcache.xsd";
}
/** @see ServerConfiguration#getBackendTimeout() */
@@ -186,10 +183,7 @@ public ServiceInformation getServiceInformation() {
return serviceInformation;
}
- /**
- * @see ServerConfiguration#setServiceInformation(ServiceInformation) the serviceInformation to
- * set
- */
+ /** @see ServerConfiguration#setServiceInformation(ServiceInformation) the serviceInformation to set */
public void setServiceInformation(ServiceInformation serviceInformation) {
this.serviceInformation = serviceInformation;
}
@@ -231,14 +225,11 @@ public LockProvider getLockProvider() {
Object provider = GeoWebCacheExtensions.bean(lockProvider);
if (provider == null) {
throw new RuntimeException(
- "Could not find lock provider "
- + lockProvider
- + " in the spring application context");
+ "Could not find lock provider " + lockProvider + " in the spring application context");
} else if (!(provider instanceof LockProvider)) {
- throw new RuntimeException(
- "Found bean "
- + lockProvider
- + " in the spring application context, but it was not a LockProvider");
+ throw new RuntimeException("Found bean "
+ + lockProvider
+ + " in the spring application context, but it was not a LockProvider");
} else {
lockProviderInstance = (LockProvider) provider;
}
@@ -279,8 +270,7 @@ public void setFullWMS(Boolean fullWMS) {
}
/**
- * If this method returns NULL CITE strict compliance mode should not be considered for WMTS
- * service implementation.
+ * If this method returns NULL CITE strict compliance mode should not be considered for WMTS service implementation.
*
* @return may return TRUE, FALSE or NULL
*/
@@ -289,11 +279,9 @@ public boolean isWmtsCiteCompliant() {
}
/**
- * Can be used to force WMTS service implementation to be strictly compliant with the
- * correspondent CITE tests.
+ * Can be used to force WMTS service implementation to be strictly compliant with the correspondent CITE tests.
*
- * @param wmtsCiteCompliant TRUE or FALSE, activating or deactivation CITE strict compliance
- * mode for WMTS
+ * @param wmtsCiteCompliant TRUE or FALSE, activating or deactivation CITE strict compliance mode for WMTS
*/
public void setWmtsCiteCompliant(boolean wmtsCiteCompliant) {
this.wmtsCiteCompliant = wmtsCiteCompliant;
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/GridSetConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/GridSetConfiguration.java
index 6f6ce697ca..22bac273ac 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/GridSetConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/GridSetConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -43,12 +42,11 @@ default Set getGridSetNames() {
* Adds a new {@link GridSet} to the configuration
*
* @param gridSet the gridset to add
- * @throws IllegalArgumentException if this configuration is not capable of saving the specific
- * type of gridset given, or if any required piece of information is missing or invalid in
- * the gridset (for example, a missing or duplicated name or id, etc).
+ * @throws IllegalArgumentException if this configuration is not capable of saving the specific type of gridset
+ * given, or if any required piece of information is missing or invalid in the gridset (for example, a missing
+ * or duplicated name or id, etc).
*/
- void addGridSet(final GridSet gridSet)
- throws UnsupportedOperationException, IllegalArgumentException;
+ void addGridSet(final GridSet gridSet) throws UnsupportedOperationException, IllegalArgumentException;
/**
* Removes an existing gridset from the configuration
@@ -56,16 +54,15 @@ void addGridSet(final GridSet gridSet)
* @throws NoSuchElementException If there is no existing gridset by that name.
* @throws UnsupportedOperationException if removing this gridset is not supported
*/
- void removeGridSet(String gridSetName)
- throws NoSuchElementException, UnsupportedOperationException;
+ void removeGridSet(String gridSetName) throws NoSuchElementException, UnsupportedOperationException;
/**
* Changes a gridset
*
* @param gridSet The modified gridset. Should have the same name as an existing gridset.
- * @throws IllegalArgumentException if this configuration is not able to save the specific type
- * of gridset given, or if any required piece of information is missing or invalid in the
- * gridset (for example, a missing name or id, etc).
+ * @throws IllegalArgumentException if this configuration is not able to save the specific type of gridset given, or
+ * if any required piece of information is missing or invalid in the gridset (for example, a missing name or id,
+ * etc).
* @throws NoSuchElementException If there is no existing gridset by that name.
* @throws UnsupportedOperationException if removing this gridset is not supported
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/Info.java b/geowebcache/core/src/main/java/org/geowebcache/config/Info.java
index bc70500176..c6b2abd5f1 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/Info.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/Info.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/ListenerCollection.java b/geowebcache/core/src/main/java/org/geowebcache/config/ListenerCollection.java
index a94149ed75..7f96fcf8fc 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/ListenerCollection.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/ListenerCollection.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -49,28 +48,23 @@ public static interface HandlerMethod {
}
/**
- * Perform an operation on each listener. If one throws an exception, the others will still
- * execute. If more than one exception is thrown, the last will be the one propagated, with the
- * others added as suppressed exceptions. If an Error is thrown, it will be propagated
- * immediately.
+ * Perform an operation on each listener. If one throws an exception, the others will still execute. If more than
+ * one exception is thrown, the last will be the one propagated, with the others added as suppressed exceptions. If
+ * an Error is thrown, it will be propagated immediately.
*/
- public synchronized void safeForEach(HandlerMethod method)
- throws GeoWebCacheException, IOException {
- LinkedList exceptions =
- listeners.stream()
- .map(
- l -> {
- try {
- method.callOn(l);
- return Optional.empty();
- } catch (Exception ex) {
- return Optional.of(ex);
- }
- })
- .filter(Optional::isPresent)
- .map(Optional::get)
- .collect(
- Collectors.collectingAndThen(Collectors.toList(), LinkedList::new));
+ public synchronized void safeForEach(HandlerMethod method) throws GeoWebCacheException, IOException {
+ LinkedList exceptions = listeners.stream()
+ .map(l -> {
+ try {
+ method.callOn(l);
+ return Optional.empty();
+ } catch (Exception ex) {
+ return Optional.of(ex);
+ }
+ })
+ .filter(Optional::isPresent)
+ .map(Optional::get)
+ .collect(Collectors.collectingAndThen(Collectors.toList(), LinkedList::new));
if (!exceptions.isEmpty()) {
Iterator it = exceptions.descendingIterator();
Exception ex = it.next();
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/ServerConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/ServerConfiguration.java
index 3cc862cea9..7503d152f0 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/ServerConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/ServerConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -21,14 +20,12 @@
/**
* Interface for managing global server configuration information.
*
- *
In general, a running GeoWebCache application should only include a single instance of
- * ServerConfiguration
+ *
In general, a running GeoWebCache application should only include a single instance of ServerConfiguration
*/
public interface ServerConfiguration extends BaseConfiguration {
/**
- * Service information such as you or your company's details that you want provided in
- * capabilities documents.
+ * Service information such as you or your company's details that you want provided in capabilities documents.
*
* @return ServiceInformation for the ServerConfiguration
*/
@@ -38,9 +35,8 @@ public interface ServerConfiguration extends BaseConfiguration {
void setServiceInformation(ServiceInformation serviceInfo) throws IOException;
/**
- * Runtime statistics run, by default, every three second and provide data about how many
- * requests the system has been serving in the past 3, 15 and 60 seconds, as well as aggregate
- * numbers.
+ * Runtime statistics run, by default, every three second and provide data about how many requests the system has
+ * been serving in the past 3, 15 and 60 seconds, as well as aggregate numbers.
*
* @return True or False if disabled
*/
@@ -70,25 +66,22 @@ public interface ServerConfiguration extends BaseConfiguration {
void setFullWMS(Boolean isFullWMS) throws IOException;
/**
- * If this method returns NULL CITE strict compliance mode should not be considered for WMTS
- * service implementation.
+ * If this method returns NULL CITE strict compliance mode should not be considered for WMTS service implementation.
*
* @return may return TRUE, FALSE or NULL
*/
Boolean isWmtsCiteCompliant();
/**
- * Can be used to force WMTS service implementation to be strictly compliant with the
- * correspondent CITE tests.
+ * Can be used to force WMTS service implementation to be strictly compliant with the correspondent CITE tests.
*
- * @param wmtsCiteStrictCompliant TRUE or FALSE, activating or deactivation CITE strict
- * compliance mode for WMTS
+ * @param wmtsCiteStrictCompliant TRUE or FALSE, activating or deactivation CITE strict compliance mode for WMTS
*/
void setWmtsCiteCompliant(Boolean wmtsCiteStrictCompliant) throws IOException;
/**
- * The backend timeout is the number of seconds GWC will wait for a backend server to return
- * something before closing the connection.
+ * The backend timeout is the number of seconds GWC will wait for a backend server to return something before
+ * closing the connection.
*
* @return The backend timeout for this configuration.
*/
@@ -98,8 +91,8 @@ public interface ServerConfiguration extends BaseConfiguration {
void setBackendTimeout(Integer backendTimeout) throws IOException;
/**
- * Determines whether cached=false is allowed for requests going through the WMS service,
- * including converters such as Google Maps.
+ * Determines whether cached=false is allowed for requests going through the WMS service, including converters such
+ * as Google Maps.
*
* @return True or False
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/SimpleGridSetConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/SimpleGridSetConfiguration.java
index f38fce8a74..55452951b0 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/SimpleGridSetConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/SimpleGridSetConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -44,14 +43,12 @@ public Collection getGridSets() {
}
@Override
- public void addGridSet(GridSet gridSet)
- throws UnsupportedOperationException, IllegalArgumentException {
+ public void addGridSet(GridSet gridSet) throws UnsupportedOperationException, IllegalArgumentException {
throw new UnsupportedOperationException();
}
@Override
- public void removeGridSet(String gridSetName)
- throws NoSuchElementException, UnsupportedOperationException {
+ public void removeGridSet(String gridSetName) throws NoSuchElementException, UnsupportedOperationException {
throw new UnsupportedOperationException();
}
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/TileLayerConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/TileLayerConfiguration.java
index 8817dcb8ba..795e156564 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/TileLayerConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/TileLayerConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, The Open Planning Project, Copyright 2008
*/
@@ -26,8 +25,7 @@
/**
* A layer provider for {@link TileLayerDispatcher}.
*
- *
Implementations must be singletons discoverable through {@link GeoWebCacheExtensions} (i.e.
- * spring beans)
+ *
Implementations must be singletons discoverable through {@link GeoWebCacheExtensions} (i.e. spring beans)
*/
public interface TileLayerConfiguration extends BaseConfiguration {
@@ -39,12 +37,10 @@ public interface TileLayerConfiguration extends BaseConfiguration {
Collection extends TileLayer> getLayers();
/**
- * Gets a single {@link TileLayer} from the configuration, using the layer's unique name as a
- * key.
+ * Gets a single {@link TileLayer} from the configuration, using the layer's unique name as a key.
*
* @param layerName the layer name
- * @return the layer named {@code layerIdent} or {@code null} if no such layer exists in this
- * configuration
+ * @return the layer named {@code layerIdent} or {@code null} if no such layer exists in this configuration
*/
Optional getLayer(String layerName);
@@ -73,8 +69,7 @@ public interface TileLayerConfiguration extends BaseConfiguration {
/**
* Replaces an existing tile layer of the same name with this tile layer.
*
- * @param tl the modified tile layer. Its name must be the same as a tile layer that already
- * exists.
+ * @param tl the modified tile layer. Its name must be the same as a tile layer that already exists.
* @throws NoSuchElementException If no tile layer with a matching name exists.
*/
void modifyLayer(TileLayer tl) throws NoSuchElementException;
@@ -87,17 +82,15 @@ public interface TileLayerConfiguration extends BaseConfiguration {
* @throws NoSuchElementException If no tile layer with a matching name exists.
* @throws IllegalArgumentException If a tile layer with the new name already exists
*/
- void renameLayer(String oldName, String newName)
- throws NoSuchElementException, IllegalArgumentException;
+ void renameLayer(String oldName, String newName) throws NoSuchElementException, IllegalArgumentException;
/**
- * Adds the given tile layer to this configuration, provided {@link #canSave(TileLayer)
- * canSave(tl) == true}.
+ * Adds the given tile layer to this configuration, provided {@link #canSave(TileLayer) canSave(tl) == true}.
*
* @param tl the tile layer to add to the configuration
- * @throws IllegalArgumentException if this configuration is not able of saving the specific
- * type of layer given, or if any required piece of information is missing or invalid in the
- * layer (for example, a missing or duplicated name or id, etc).
+ * @throws IllegalArgumentException if this configuration is not able of saving the specific type of layer given, or
+ * if any required piece of information is missing or invalid in the layer (for example, a missing or duplicated
+ * name or id, etc).
*/
void addLayer(TileLayer tl) throws IllegalArgumentException;
@@ -113,9 +106,9 @@ void renameLayer(String oldName, String newName)
* Whether the configuration is capable of saving the provided tile layer.
*
* @param tl a tile layer to be added or saved
- * @return {@code true} if this configuration is capable of saving the given tile layer, {@code
- * false} otherwise (usually this check is based on an instanceof check, as different
- * configurations may be specialized on different kinds of layers).
+ * @return {@code true} if this configuration is capable of saving the given tile layer, {@code false} otherwise
+ * (usually this check is based on an instanceof check, as different configurations may be specialized on
+ * different kinds of layers).
*/
boolean canSave(TileLayer tl);
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/XMLConfiguration.java b/geowebcache/core/src/main/java/org/geowebcache/config/XMLConfiguration.java
index 7bb2a81639..6206baaa3b 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/XMLConfiguration.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/XMLConfiguration.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, Marius Suta, The Open Planning Project, Copyright 2008
*/
@@ -102,10 +101,9 @@
/**
* XMLConfiguration class responsible for reading/writing layer configurations to and from XML file
*
- *
NOTE {@link #setGridSetBroker(GridSetBroker)} MUST have been called before any other method is
- * used, otherwise this configuration is in an inconsistent and unpredictable state, and will throw
- * an {@link IllegalStateException}. This is set automatically by Spring through the use of {@link
- * Autowired}
+ *
NOTE {@link #setGridSetBroker(GridSetBroker)} MUST have been called before any other method is used, otherwise
+ * this configuration is in an inconsistent and unpredictable state, and will throw an {@link IllegalStateException}.
+ * This is set automatically by Spring through the use of {@link Autowired}
*/
public class XMLConfiguration
implements TileLayerConfiguration,
@@ -132,16 +130,14 @@ public class XMLConfiguration
private GridSetBroker gridSetBroker;
- private ListenerCollection blobStoreListeners =
- new ListenerCollection<>();
+ private ListenerCollection blobStoreListeners = new ListenerCollection<>();
/**
* Base Constructor with custom {@link ConfigurationResourceProvider}.
*
* @param appCtx use to lookup {@link XMLConfigurationProvider} extensions, may be {@code null}
*/
- public XMLConfiguration(
- final ApplicationContextProvider appCtx, final ConfigurationResourceProvider inFac) {
+ public XMLConfiguration(final ApplicationContextProvider appCtx, final ConfigurationResourceProvider inFac) {
this.context = appCtx == null ? null : appCtx.getApplicationContext();
this.resourceProvider = inFac;
}
@@ -159,34 +155,23 @@ public XMLConfiguration(
this(
appCtx,
new XMLFileResourceProvider(
- DEFAULT_CONFIGURATION_FILE_NAME,
- appCtx,
- configFileDirectory,
- storageDirFinder));
+ DEFAULT_CONFIGURATION_FILE_NAME, appCtx, configFileDirectory, storageDirFinder));
resourceProvider.setTemplate("/" + DEFAULT_CONFIGURATION_FILE_NAME);
}
/**
- * Constructor that will look for {@code geowebcache.xml} at the directory defined by {@code
- * storageDirFinder}
+ * Constructor that will look for {@code geowebcache.xml} at the directory defined by {@code storageDirFinder}
*
* @param appCtx use to lookup {@link XMLConfigurationProvider} extenions, may be {@code null}
*/
- public XMLConfiguration(
- final ApplicationContextProvider appCtx, final DefaultStorageFinder storageDirFinder)
+ public XMLConfiguration(final ApplicationContextProvider appCtx, final DefaultStorageFinder storageDirFinder)
throws ConfigurationException {
- this(
- appCtx,
- new XMLFileResourceProvider(
- DEFAULT_CONFIGURATION_FILE_NAME, appCtx, storageDirFinder));
+ this(appCtx, new XMLFileResourceProvider(DEFAULT_CONFIGURATION_FILE_NAME, appCtx, storageDirFinder));
resourceProvider.setTemplate("/" + DEFAULT_CONFIGURATION_FILE_NAME);
}
- /**
- * Constructor that will accept an absolute or relative path for finding {@code geowebcache.xml}
- */
- public XMLConfiguration(
- final ApplicationContextProvider appCtx, final String configFileDirectory)
+ /** Constructor that will accept an absolute or relative path for finding {@code geowebcache.xml} */
+ public XMLConfiguration(final ApplicationContextProvider appCtx, final String configFileDirectory)
throws ConfigurationException {
this(appCtx, configFileDirectory, null);
}
@@ -276,29 +261,22 @@ public void setDefaultValues(TileLayer layer) {
} catch (MalformedURLException e) {
log.log(
Level.SEVERE,
- "could not parse proxy URL "
- + wl.getProxyUrl()
- + " ! continuing WITHOUT proxy!",
+ "could not parse proxy URL " + wl.getProxyUrl() + " ! continuing WITHOUT proxy!",
e);
}
final WMSHttpHelper sourceHelper;
if (wl.getHttpUsername() != null) {
- sourceHelper =
- new WMSHttpHelper(wl.getHttpUsername(), wl.getHttpPassword(), proxyUrl);
- log.fine(
- "Using per-layer HTTP credentials for "
- + wl.getName()
- + ", "
- + "username "
- + wl.getHttpUsername());
+ sourceHelper = new WMSHttpHelper(wl.getHttpUsername(), wl.getHttpPassword(), proxyUrl);
+ log.fine("Using per-layer HTTP credentials for "
+ + wl.getName()
+ + ", "
+ + "username "
+ + wl.getHttpUsername());
} else if (getGwcConfig().getHttpUsername() != null) {
- sourceHelper =
- new WMSHttpHelper(
- getGwcConfig().getHttpUsername(),
- getGwcConfig().getHttpPassword(),
- proxyUrl);
+ sourceHelper = new WMSHttpHelper(
+ getGwcConfig().getHttpUsername(), getGwcConfig().getHttpPassword(), proxyUrl);
log.fine("Using global HTTP credentials for " + wl.getName());
} else {
sourceHelper = new WMSHttpHelper(null, null, proxyUrl);
@@ -317,18 +295,15 @@ private GeoWebCacheConfiguration loadConfiguration() throws ConfigurationExcepti
return loadConfiguration(in);
}
} catch (IOException e) {
- throw new ConfigurationException(
- "Error parsing config file " + resourceProvider.getId(), e);
+ throw new ConfigurationException("Error parsing config file " + resourceProvider.getId(), e);
}
}
- private GeoWebCacheConfiguration loadConfiguration(InputStream xmlFile)
- throws IOException, ConfigurationException {
+ private GeoWebCacheConfiguration loadConfiguration(InputStream xmlFile) throws IOException, ConfigurationException {
Node rootNode = loadDocument(xmlFile);
XStream xs = getConfiguredXStreamWithContext(new GeoWebCacheXStream(), Context.PERSIST);
- GeoWebCacheConfiguration config =
- (GeoWebCacheConfiguration) xs.unmarshal(new DomReader((Element) rootNode));
+ GeoWebCacheConfiguration config = (GeoWebCacheConfiguration) xs.unmarshal(new DomReader((Element) rootNode));
return config;
}
@@ -340,10 +315,7 @@ private synchronized void save() throws IOException {
try {
resourceProvider.backup();
} catch (Exception e) {
- log.log(
- Level.WARNING,
- "Error creating back up of configuration file " + resourceProvider.getId(),
- e);
+ log.log(Level.WARNING, "Error creating back up of configuration file " + resourceProvider.getId(), e);
}
persistToFile();
@@ -363,9 +335,7 @@ public XStream getConfiguredXStreamWithContext(
}
public static XStream getConfiguredXStreamWithContext(
- XStream xs,
- WebApplicationContext context,
- ContextualConfigurationProvider.Context providerContext) {
+ XStream xs, WebApplicationContext context, ContextualConfigurationProvider.Context providerContext) {
{
// Allow any implementation of these extension points
@@ -460,8 +430,7 @@ public static XStream getConfiguredXStreamWithContext(
&&
// Check if the context is applicable for the provider
(providerContext == null
- || !((ContextualConfigurationProvider) extension)
- .appliesTo(providerContext))) {
+ || !((ContextualConfigurationProvider) extension).appliesTo(providerContext))) {
// If so, try the next one
continue;
}
@@ -494,13 +463,8 @@ private void persistToFile() throws IOException {
} catch (FileNotFoundException fnfe) {
throw fnfe;
} catch (IOException e) {
- throw (IOException)
- new IOException(
- "Error writing to "
- + resourceProvider.getId()
- + ": "
- + e.getMessage())
- .initCause(e);
+ throw (IOException) new IOException("Error writing to " + resourceProvider.getId() + ": " + e.getMessage())
+ .initCause(e);
}
log.info("Wrote configuration to " + resourceProvider.getId());
@@ -522,8 +486,7 @@ protected boolean canSaveIfNotTransient(TileLayer tl) {
if (tl instanceof WMSLayer) {
return true;
}
- return GeoWebCacheExtensions.extensions(XMLConfigurationProvider.class, this.context)
- .stream()
+ return GeoWebCacheExtensions.extensions(XMLConfigurationProvider.class, this.context).stream()
.anyMatch(provider -> provider.canSave(tl));
}
@@ -590,19 +553,14 @@ public synchronized void modifyLayer(TileLayer tl) throws NoSuchElementException
}
protected TileLayer findLayer(String layerName) throws NoSuchElementException {
- TileLayer layer =
- getLayer(layerName)
- .orElseThrow(
- () ->
- new NoSuchElementException(
- "Layer " + layerName + " does not exist"));
+ TileLayer layer = getLayer(layerName)
+ .orElseThrow(() -> new NoSuchElementException("Layer " + layerName + " does not exist"));
return layer;
}
/** @see TileLayerConfiguration#renameLayer(String, String) */
@Override
- public void renameLayer(String oldName, String newName)
- throws NoSuchElementException, IllegalArgumentException {
+ public void renameLayer(String oldName, String newName) throws NoSuchElementException, IllegalArgumentException {
throw new UnsupportedOperationException(
"renameLayer is not supported by " + getClass().getSimpleName());
}
@@ -634,8 +592,7 @@ public synchronized void removeLayer(final String layerName)
}
/** */
- private synchronized void addOrReplaceGridSet(final XMLGridSet gridSet)
- throws IllegalArgumentException {
+ private synchronized void addOrReplaceGridSet(final XMLGridSet gridSet) throws IllegalArgumentException {
final String gridsetName = gridSet.getName();
List xmlGridSets = getGwcConfig().getGridSets();
@@ -758,9 +715,7 @@ private static Node checkAndTransform(Document doc) throws ConfigurationExceptio
// Check again after transform
if (!rootNode.getNodeName().equals("gwcConfiguration")) {
- log.log(
- Level.SEVERE,
- "Unable to parse file, expected gwcConfiguration at root after transform.");
+ log.log(Level.SEVERE, "Unable to parse file, expected gwcConfiguration at root after transform.");
throw new ConfigurationException("Unable to parse after transform.");
} else {
// Parsing the schema file
@@ -869,29 +824,24 @@ private void updateLayers() {
private void loadGridSets() {
if (getGwcConfig().getGridSets() != null) {
- this.gridSets =
- getGwcConfig().getGridSets().stream()
- .map(
- (xmlGridSet) -> {
- if (log.isLoggable(Level.FINE)) {
- log.fine("Reading " + xmlGridSet.getName());
- }
-
- GridSet gridSet = xmlGridSet.makeGridSet();
-
- log.info("Read GridSet " + gridSet.getName());
- return gridSet;
- })
- .collect(
- Collectors.toMap(
- GridSet::getName,
- Function.identity(),
- (GridSet x, GridSet y) -> {
- throw new IllegalStateException(
- "Gridsets with duplicate name "
- + x.getName());
- },
- HashMap::new));
+ this.gridSets = getGwcConfig().getGridSets().stream()
+ .map((xmlGridSet) -> {
+ if (log.isLoggable(Level.FINE)) {
+ log.fine("Reading " + xmlGridSet.getName());
+ }
+
+ GridSet gridSet = xmlGridSet.makeGridSet();
+
+ log.info("Read GridSet " + gridSet.getName());
+ return gridSet;
+ })
+ .collect(Collectors.toMap(
+ GridSet::getName,
+ Function.identity(),
+ (GridSet x, GridSet y) -> {
+ throw new IllegalStateException("Gridsets with duplicate name " + x.getName());
+ },
+ HashMap::new));
}
}
@@ -989,28 +939,23 @@ public void setFullWMS(Boolean isFullWMS) throws IOException {
@Override
public List getBlobStores() {
// need to return an unmodifiable list of unmodifiable BlobStoreInfos
- return Collections.unmodifiableList(
- getGwcConfig().getBlobStores().stream()
- .map(
- (info) -> {
- return (BlobStoreInfo) info.clone();
- })
- .collect(Collectors.toList()));
+ return Collections.unmodifiableList(getGwcConfig().getBlobStores().stream()
+ .map((info) -> {
+ return (BlobStoreInfo) info.clone();
+ })
+ .collect(Collectors.toList()));
}
/** @see BlobStoreConfiguration#addBlobStore(org.geowebcache.config.BlobStoreInfo) */
@Override
public synchronized void addBlobStore(BlobStoreInfo info) {
if (info.getName() == null) {
- throw new IllegalArgumentException(
- "Failed to add BlobStoreInfo. A BlobStoreInfo name cannot be null");
+ throw new IllegalArgumentException("Failed to add BlobStoreInfo. A BlobStoreInfo name cannot be null");
}
// ensure there isn't a BlobStoreInfo with the same name already
if (getBlobStoreNames().contains(info.getName())) {
- throw new IllegalArgumentException(
- String.format(
- "Failed to add BlobStoreInfo. A BlobStoreInfo with name \"%s\" already exists",
- info.getName()));
+ throw new IllegalArgumentException(String.format(
+ "Failed to add BlobStoreInfo. A BlobStoreInfo with name \"%s\" already exists", info.getName()));
}
// add the BlobStoreInfo
final List blobStores = getGwcConfig().getBlobStores();
@@ -1021,14 +966,12 @@ public synchronized void addBlobStore(BlobStoreInfo info) {
} catch (IOException ioe) {
// save failed, roll back the add
blobStores.remove(info);
- throw new ConfigurationPersistenceException(
- String.format("Unable to add BlobStoreInfo \"%s\"", info), ioe);
+ throw new ConfigurationPersistenceException(String.format("Unable to add BlobStoreInfo \"%s\"", info), ioe);
}
try {
- blobStoreListeners.safeForEach(
- listener -> {
- listener.handleAddBlobStore(info);
- });
+ blobStoreListeners.safeForEach(listener -> {
+ listener.handleAddBlobStore(info);
+ });
} catch (IOException | GeoWebCacheException e) {
if (ExceptionUtils.isOrSuppresses(e, UnsuitableStorageException.class)) {
// Can't store here, roll back
@@ -1044,14 +987,9 @@ public synchronized void addBlobStore(BlobStoreInfo info) {
@Override
public synchronized void removeBlobStore(String name) {
// ensure there is a BlobStoreInfo with the name
- final BlobStoreInfo infoToRemove =
- getBlobStore(name)
- .orElseThrow(
- () ->
- new NoSuchElementException(
- String.format(
- "Failed to remove BlobStoreInfo. A BlobStoreInfo with name \"%s\" does not exist.",
- name)));
+ final BlobStoreInfo infoToRemove = getBlobStore(name)
+ .orElseThrow(() -> new NoSuchElementException(String.format(
+ "Failed to remove BlobStoreInfo. A BlobStoreInfo with name \"%s\" does not exist.", name)));
// remove the BlobStoreInfo
final List blobStores = getGwcConfig().getBlobStores();
blobStores.remove(infoToRemove);
@@ -1065,10 +1003,9 @@ public synchronized void removeBlobStore(String name) {
String.format("Unable to remove BlobStoreInfo \"%s\"", name), ioe);
}
try {
- blobStoreListeners.safeForEach(
- listener -> {
- listener.handleRemoveBlobStore(infoToRemove);
- });
+ blobStoreListeners.safeForEach(listener -> {
+ listener.handleRemoveBlobStore(infoToRemove);
+ });
} catch (IOException | GeoWebCacheException e) {
throw new ConfigurationPersistenceException(e);
}
@@ -1083,10 +1020,9 @@ public synchronized void modifyBlobStore(BlobStoreInfo info) {
// ensure there is a BlobStoreInfo with the name
final Optional optionalInfo = getBlobStore(info.getName());
if (!optionalInfo.isPresent()) {
- throw new NoSuchElementException(
- String.format(
- "Failed to modify BlobStoreInfo. A BlobStoreInfo with name \"%s\" does not exist.",
- info.getName()));
+ throw new NoSuchElementException(String.format(
+ "Failed to modify BlobStoreInfo. A BlobStoreInfo with name \"%s\" does not exist.",
+ info.getName()));
}
// remove existing and add the new one
final List blobStores = getGwcConfig().getBlobStores();
@@ -1104,10 +1040,9 @@ public synchronized void modifyBlobStore(BlobStoreInfo info) {
String.format("Unable to modify BlobStoreInfo \"%s\"", info.getName()), ioe);
}
try {
- blobStoreListeners.safeForEach(
- listener -> {
- listener.handleModifyBlobStore(info);
- });
+ blobStoreListeners.safeForEach(listener -> {
+ listener.handleModifyBlobStore(info);
+ });
} catch (IOException | GeoWebCacheException e) {
if (ExceptionUtils.isOrSuppresses(e, UnsuitableStorageException.class)) {
// Can't store here, roll back
@@ -1130,10 +1065,9 @@ public int getBlobStoreCount() {
@Override
public Set getBlobStoreNames() {
return getGwcConfig().getBlobStores().stream()
- .map(
- (info) -> {
- return info.getName();
- })
+ .map((info) -> {
+ return info.getName();
+ })
.collect(Collectors.toSet());
}
@@ -1165,9 +1099,7 @@ public void renameBlobStore(String oldName, String newName)
final Optional newInfo = getBlobStore(newName);
if (newInfo.isPresent()) {
throw new IllegalArgumentException(
- "BlobStoreInfo rename unsuccessful. A BlobStoreInfo with name \""
- + newName
- + "\" already exists.");
+ "BlobStoreInfo rename unsuccessful. A BlobStoreInfo with name \"" + newName + "\" already exists.");
}
// get the list of BlobStoreInfos
final List blobStoreInfos = getGwcConfig().getBlobStores();
@@ -1190,9 +1122,7 @@ public void renameBlobStore(String oldName, String newName)
// if we didn't remove one, it wasn't in there to be removed
if (blobStoreInfoToRename == null) {
throw new NoSuchElementException(
- "BlobStoreInfo rename unsuccessful. No BlobStoreInfo with name \""
- + oldName
- + "\" exists.");
+ "BlobStoreInfo rename unsuccessful. No BlobStoreInfo with name \"" + oldName + "\" exists.");
}
// rename it and add it back to the list
// for BlobStoreInfo instances, "name" and "id" are the same thing.
@@ -1203,10 +1133,7 @@ public void renameBlobStore(String oldName, String newName)
save();
if (log.isLoggable(Level.FINER)) {
- log.finer(
- String.format(
- "BlobStoreInfo rename from \"%s\" to \"%s\" successful.",
- oldName, newName));
+ log.finer(String.format("BlobStoreInfo rename from \"%s\" to \"%s\" successful.", oldName, newName));
}
} catch (IOException ioe) {
// save didn't work, need to roll things back
@@ -1223,25 +1150,20 @@ public void renameBlobStore(String oldName, String newName)
if (blobStoreInfoToRevert == null) {
// we're really messed up now as we couldn't find the BlobStoreInfo that was just
// renamed.
- throw new ConfigurationPersistenceException(
- String.format(
- "Error reverting BlobStoreInfo modification. Could not revert rename from \"%s\" to \"%s\"",
- oldName, newName));
+ throw new ConfigurationPersistenceException(String.format(
+ "Error reverting BlobStoreInfo modification. Could not revert rename from \"%s\" to \"%s\"",
+ oldName, newName));
}
// revert the name and add it back to the list
blobStoreInfoToRevert.setName(oldName);
blobStoreInfos.add(blobStoreInfoToRevert);
throw new ConfigurationPersistenceException(
- String.format(
- "Unable to rename BlobStoreInfo from \"%s\" to \"%s\"",
- oldName, newName),
- ioe);
+ String.format("Unable to rename BlobStoreInfo from \"%s\" to \"%s\"", oldName, newName), ioe);
}
try {
- blobStoreListeners.safeForEach(
- listener -> {
- listener.handleRenameBlobStore(oldName, blobStoreInfoToRename);
- });
+ blobStoreListeners.safeForEach(listener -> {
+ listener.handleRenameBlobStore(oldName, blobStoreInfoToRename);
+ });
} catch (IOException | GeoWebCacheException e) {
throw new ConfigurationPersistenceException(
String.format(
@@ -1294,10 +1216,7 @@ private GeoWebCacheConfiguration getGwcConfig() {
}
} catch (ConfigurationException e) {
throw new IllegalStateException(
- "Configuration "
- + getIdentifier()
- + " is not fully initialized and lazy initialization failed",
- e);
+ "Configuration " + getIdentifier() + " is not fully initialized and lazy initialization failed", e);
}
return gwcConfig;
}
@@ -1318,11 +1237,9 @@ public Boolean isWmtsCiteCompliant() {
}
/**
- * Can be used to force WMTS service implementation to be strictly compliant with the
- * correspondent CITE tests.
+ * Can be used to force WMTS service implementation to be strictly compliant with the correspondent CITE tests.
*
- * @param wmtsCiteStrictCompliant TRUE or FALSE, activating or deactivation CITE strict
- * compliance mode for WMTS
+ * @param wmtsCiteStrictCompliant TRUE or FALSE, activating or deactivation CITE strict compliance mode for WMTS
*/
@Override
public void setWmtsCiteCompliant(Boolean wmtsCiteStrictCompliant) throws IOException {
@@ -1420,8 +1337,7 @@ public synchronized void removeGridSet(String gridSetName) {
assert Objects.isNull(gsRemoved) == Objects.isNull(xgsRemoved);
if (Objects.isNull(gsRemoved)) {
- throw new NoSuchElementException(
- "Could not remeove GridSet " + gridSetName + " as it does not exist");
+ throw new NoSuchElementException("Could not remeove GridSet " + gridSetName + " as it does not exist");
}
try {
@@ -1429,8 +1345,7 @@ public synchronized void removeGridSet(String gridSetName) {
} catch (IOException ex) {
getGridSetsInternal().put(gridSetName, gsRemoved);
getGwcConfig().getGridSets().add(xgsRemoved);
- throw new ConfigurationPersistenceException(
- "Could not persist removal of Gridset " + gridSetName, ex);
+ throw new ConfigurationPersistenceException("Could not persist removal of Gridset " + gridSetName, ex);
}
}
@@ -1453,9 +1368,7 @@ protected Map getGridSetsInternal() {
@Override
public Collection getGridSets() {
- return getGridSetsInternal().values().stream()
- .map(GridSet::new)
- .collect(Collectors.toList());
+ return getGridSetsInternal().values().stream().map(GridSet::new).collect(Collectors.toList());
}
@Override
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/XMLConfigurationProvider.java b/geowebcache/core/src/main/java/org/geowebcache/config/XMLConfigurationProvider.java
index f08a333517..b31080eaca 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/XMLConfigurationProvider.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/XMLConfigurationProvider.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2018
*/
@@ -17,21 +16,18 @@
import com.thoughtworks.xstream.XStream;
/**
- * Extension point for {@link XMLConfiguration} to allow decoupled modules to contribute to the
- * configuration set up in order to extend the {@code geowebcache.xml} contents with new constructs.
+ * Extension point for {@link XMLConfiguration} to allow decoupled modules to contribute to the configuration set up in
+ * order to extend the {@code geowebcache.xml} contents with new constructs.
*
* @author Gabriel Roldan
*/
public interface XMLConfigurationProvider {
/**
- * Allows an extension to enhance the {@link XMLConfiguration} XStream persister to handle new
- * contructs.
+ * Allows an extension to enhance the {@link XMLConfiguration} XStream persister to handle new contructs.
*
- * @param xs the XStream persister configured with the default elements from {@link
- * XMLConfiguration}
- * @return the modified (possibly the same) XStream persister with the extension point's added
- * xml mappings
+ * @param xs the XStream persister configured with the default elements from {@link XMLConfiguration}
+ * @return the modified (possibly the same) XStream persister with the extension point's added xml mappings
*/
XStream getConfiguredXStream(XStream xs);
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/XMLFileResourceProvider.java b/geowebcache/core/src/main/java/org/geowebcache/config/XMLFileResourceProvider.java
index e039bb4d8e..15c42a0493 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/XMLFileResourceProvider.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/XMLFileResourceProvider.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, Marius Suta, The Open Planning Project, Copyright 2008 - 2015
* @author Niels Charlier
@@ -65,8 +64,7 @@ public XMLFileResourceProvider(
throws ConfigurationException {
if (configFileDirectory == null && storageDirFinder == null) {
- throw new NullPointerException(
- "At least one of configFileDirectory or storageDirFinder must not be null");
+ throw new NullPointerException("At least one of configFileDirectory or storageDirFinder must not be null");
}
this.context = appCtx;
@@ -76,24 +74,19 @@ public XMLFileResourceProvider(
// Use the given path
if (new File(configFileDirectory).isAbsolute()) {
- log.config(
- "Provided configuration directory as absolute path '"
- + configFileDirectory
- + "'");
+ log.config("Provided configuration directory as absolute path '" + configFileDirectory + "'");
this.configDirectory = new File(configFileDirectory);
} else {
ServletContext servletContext = context.getServletContext();
if (servletContext != null) {
String baseDir = servletContext.getRealPath("");
- log.config(
- "Provided configuration directory relative to servlet context '"
- + baseDir
- + "': "
- + configFileDirectory);
+ log.config("Provided configuration directory relative to servlet context '"
+ + baseDir
+ + "': "
+ + configFileDirectory);
this.configDirectory = new File(baseDir, configFileDirectory);
} else {
- throw new IllegalStateException(
- "Unexpected, cannot locate the config directory");
+ throw new IllegalStateException("Unexpected, cannot locate the config directory");
}
}
} else {
@@ -117,8 +110,7 @@ public XMLFileResourceProvider(
}
/**
- * Constructor that will look for {@code geowebcache.xml} at the directory defined by {@code
- * storageDirFinder}
+ * Constructor that will look for {@code geowebcache.xml} at the directory defined by {@code storageDirFinder}
*
* @param appCtx use to lookup {@link XMLConfigurationProvider} extenions, may be {@code null}
*/
@@ -127,16 +119,11 @@ public XMLFileResourceProvider(
final ApplicationContextProvider appCtx,
final DefaultStorageFinder storageDirFinder)
throws ConfigurationException {
- this(
- configFileName,
- appCtx,
- getConfigDirVar(appCtx.getApplicationContext()),
- storageDirFinder);
+ this(configFileName, appCtx, getConfigDirVar(appCtx.getApplicationContext()), storageDirFinder);
}
/**
- * Constructor that will look for {@code geowebcache.xml} at the directory defined by {@code
- * storageDirFinder}
+ * Constructor that will look for {@code geowebcache.xml} at the directory defined by {@code storageDirFinder}
*
* @param appCtx use to lookup {@link XMLConfigurationProvider} extenions, may be {@code null}
*/
@@ -183,16 +170,13 @@ private File findConfigFile() throws IOException {
}
if (!configDirectory.exists() && !configDirectory.mkdirs()) {
- throw new IOException(
- "TileLayerConfiguration directory does not exist and cannot be created: '"
- + configDirectory.getAbsolutePath()
- + "'");
+ throw new IOException("TileLayerConfiguration directory does not exist and cannot be created: '"
+ + configDirectory.getAbsolutePath()
+ + "'");
}
if (!configDirectory.canWrite()) {
throw new IOException(
- "TileLayerConfiguration directory is not writable: '"
- + configDirectory.getAbsolutePath()
- + "'");
+ "TileLayerConfiguration directory is not writable: '" + configDirectory.getAbsolutePath() + "'");
}
File xmlFile = new File(configDirectory, configFileName);
@@ -216,11 +200,10 @@ private File findOrCreateConfFile() throws IOException {
if (xmlFile.exists()) {
log.config("Found configuration file in " + configDirectory.getAbsolutePath());
} else if (templateLocation != null) {
- log.warning(
- "Found no configuration file in config directory, will create one at '"
- + xmlFile.getAbsolutePath()
- + "' from template "
- + getClass().getResource(templateLocation).toExternalForm());
+ log.warning("Found no configuration file in config directory, will create one at '"
+ + xmlFile.getAbsolutePath()
+ + "' from template "
+ + getClass().getResource(templateLocation).toExternalForm());
// grab template from classpath
try {
try (InputStream templateStream = getClass().getResourceAsStream(templateLocation);
@@ -229,8 +212,7 @@ private File findOrCreateConfFile() throws IOException {
output.flush();
}
} catch (IOException e) {
- throw new IOException(
- "Error copying template config to " + xmlFile.getAbsolutePath(), e);
+ throw new IOException("Error copying template config to " + xmlFile.getAbsolutePath(), e);
}
}
@@ -244,28 +226,21 @@ private void backUpConfig(final File xmlFile) throws IOException {
log.fine("Backing up config file " + xmlFile.getName() + " to " + backUpFileName);
- String[] previousBackUps =
- parentFile.list(
- (dir, name) -> {
- if (configFileName.equals(name)) {
- return false;
- }
- if (name.startsWith(configFileName) && name.endsWith(".bak")) {
- return true;
- }
- return false;
- });
+ String[] previousBackUps = parentFile.list((dir, name) -> {
+ if (configFileName.equals(name)) {
+ return false;
+ }
+ if (name.startsWith(configFileName) && name.endsWith(".bak")) {
+ return true;
+ }
+ return false;
+ });
final int maxBackups = 10;
if (previousBackUps != null && previousBackUps.length > maxBackups) {
Arrays.sort(previousBackUps);
String oldest = previousBackUps[0];
- log.fine(
- "Deleting oldest config backup "
- + oldest
- + " to keep a maximum of "
- + maxBackups
- + " backups.");
+ log.fine("Deleting oldest config backup " + oldest + " to keep a maximum of " + maxBackups + " backups.");
new File(parentFile, oldest).delete();
}
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/XMLGridSet.java b/geowebcache/core/src/main/java/org/geowebcache/config/XMLGridSet.java
index d7d99d7d0d..c1707cab07 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/XMLGridSet.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/XMLGridSet.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, OpenGeo, Copyright 2009
*/
@@ -67,10 +66,13 @@ public XMLGridSet() {
public XMLGridSet(XMLGridSet orig) {
setAlignTopLeft(orig.getAlignTopLeft());
setExtent(orig.getExtent() == null ? null : new BoundingBox(orig.getExtent()));
- setResolutions(orig.getResolutions() == null ? null : orig.getResolutions().clone());
+ setResolutions(
+ orig.getResolutions() == null ? null : orig.getResolutions().clone());
setLevels(orig.getLevels());
setScaleDenominators(
- orig.getScaleDenominators() == null ? null : orig.getScaleDenominators().clone());
+ orig.getScaleDenominators() == null
+ ? null
+ : orig.getScaleDenominators().clone());
setMetersPerUnit(orig.getMetersPerUnit());
setName(orig.getName());
setDescription(orig.getDescription());
@@ -185,38 +187,36 @@ public GridSet makeGridSet() {
Boolean yCoordinateFirst = getYCoordinateFirst();
if (getResolutions() != null || getScaleDenominators() != null) {
- gridSet =
- GridSetFactory.createGridSet(
- name,
- srs,
- extent,
- alignTopLeft,
- resolutions,
- scaleDenominators,
- metersPerUnit,
- pixelSize,
- scaleNames,
- tileWidth,
- tileHeight,
- yCoordinateFirst);
+ gridSet = GridSetFactory.createGridSet(
+ name,
+ srs,
+ extent,
+ alignTopLeft,
+ resolutions,
+ scaleDenominators,
+ metersPerUnit,
+ pixelSize,
+ scaleNames,
+ tileWidth,
+ tileHeight,
+ yCoordinateFirst);
} else {
if (getLevels() == null) {
setLevels(18);
}
Integer levels = getLevels();
- gridSet =
- GridSetFactory.createGridSet(
- name,
- srs,
- extent,
- alignTopLeft,
- levels,
- metersPerUnit,
- pixelSize,
- tileWidth,
- tileHeight,
- yCoordinateFirst);
+ gridSet = GridSetFactory.createGridSet(
+ name,
+ srs,
+ extent,
+ alignTopLeft,
+ levels,
+ metersPerUnit,
+ pixelSize,
+ tileWidth,
+ tileHeight,
+ yCoordinateFirst);
}
gridSet.setDescription(getDescription());
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/XMLGridSubset.java b/geowebcache/core/src/main/java/org/geowebcache/config/XMLGridSubset.java
index 73b81043f5..e612895237 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/XMLGridSubset.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/XMLGridSubset.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, OpenGeo, Copyright 2009
*/
@@ -70,10 +69,7 @@ public XMLGridSubset(XMLGridSubset sset) {
/** Builds an XMLGridSubset out of a {@link GridSubset} */
public XMLGridSubset(GridSubset sset) {
setGridSetName(sset.getName());
- setExtent(
- sset.getOriginalExtent() == null
- ? null
- : new BoundingBox(sset.getOriginalExtent()));
+ setExtent(sset.getOriginalExtent() == null ? null : new BoundingBox(sset.getOriginalExtent()));
setZoomStart(sset.getZoomStart());
setZoomStop(sset.getZoomStop());
setMinCachedLevel(sset.getMinCachedZoom());
@@ -94,12 +90,7 @@ public GridSubset getGridSubSet(GridSetBroker gridSetBroker) {
return null;
}
return GridSubsetFactory.createGridSubSet(
- gridSet,
- getExtent(),
- getZoomStart(),
- getZoomStop(),
- minCachedLevel,
- maxCachedLevel);
+ gridSet, getExtent(), getZoomStart(), getZoomStop(), minCachedLevel, maxCachedLevel);
}
public String getGridSetName() {
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/XMLOldGrid.java b/geowebcache/core/src/main/java/org/geowebcache/config/XMLOldGrid.java
index f4b2e11378..7b72e939ff 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/XMLOldGrid.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/XMLOldGrid.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, OpenGeo, Copyright 2009
*/
@@ -27,13 +26,9 @@
/**
* This class exists mainly to parse the old XML objects using XStream
*
- *
The problem is that it cannot use the GridSetBroker, so we end up with one GridSet per layer
- * anyway.
+ *
The problem is that it cannot use the GridSetBroker, so we end up with one GridSet per layer anyway.
*/
-@SuppressFBWarnings({
- "NP_UNWRITTEN_FIELD",
- "NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD",
- "UWF_NULL_FIELD"
+@SuppressFBWarnings({"NP_UNWRITTEN_FIELD", "NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_NULL_FIELD"
}) // field assignment done by XStream
public class XMLOldGrid implements Serializable {
@@ -72,52 +67,45 @@ public GridSubset convertToGridSubset(GridSetBroker gridSetBroker) {
GridSet gridSet;
- if (srs.equals(SRS.getEPSG4326())
- && gridBounds.equals(BoundingBox.WORLD4326)
- && resolutions == null) {
+ if (srs.equals(SRS.getEPSG4326()) && gridBounds.equals(BoundingBox.WORLD4326) && resolutions == null) {
gridSet = gridSetBroker.getWorldEpsg4326();
- } else if (srs.equals(SRS.getEPSG3857())
- && gridBounds.equals(BoundingBox.WORLD3857)
- && resolutions == null) {
+ } else if (srs.equals(SRS.getEPSG3857()) && gridBounds.equals(BoundingBox.WORLD3857) && resolutions == null) {
gridSet = gridSetBroker.getWorldEpsg3857();
} else {
if (resolutions != null) {
- gridSet =
- GridSetFactory.createGridSet(
- srs.toString(),
- srs,
- gridBounds,
- false,
- resolutions,
- null,
- null,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- null,
- 256,
- 256,
- false);
+ gridSet = GridSetFactory.createGridSet(
+ srs.toString(),
+ srs,
+ gridBounds,
+ false,
+ resolutions,
+ null,
+ null,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ null,
+ 256,
+ 256,
+ false);
} else {
if (zoomStop == null) {
zoomStop = 30;
}
- gridSet =
- GridSetFactory.createGridSet(
- srs.toString(),
- srs,
- gridBounds,
- false,
- zoomStop + 1,
- null,
- GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
- 256,
- 256,
- false);
+ gridSet = GridSetFactory.createGridSet(
+ srs.toString(),
+ srs,
+ gridBounds,
+ false,
+ zoomStop + 1,
+ null,
+ GridSetFactory.DEFAULT_PIXEL_SIZE_METER,
+ 256,
+ 256,
+ false);
}
}
- GridSubset gridSubset =
- GridSubsetFactory.createGridSubSet(gridSet, dataBounds, zoomStart, zoomStop);
+ GridSubset gridSubset = GridSubsetFactory.createGridSubSet(gridSet, dataBounds, zoomStart, zoomStop);
return gridSubset;
}
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendInfo.java b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendInfo.java
index 1d1ebd597d..6335cbac08 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendInfo.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendInfo.java
@@ -1,22 +1,21 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Nuno Oliveira, GeoSolutions S.A.S., Copyright 2017
*/
package org.geowebcache.config.legends;
/**
- * Simple container for the information related with a style legends. Builder {@link
- * LegendInfoBuilder} should be used to create instances of this class.
+ * Simple container for the information related with a style legends. Builder {@link LegendInfoBuilder} should be used
+ * to create instances of this class.
*/
public class LegendInfo {
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendInfoBuilder.java b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendInfoBuilder.java
index bfd077d6d8..5346b4ce70 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendInfoBuilder.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendInfoBuilder.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Nuno Oliveira, GeoSolutions S.A.S., Copyright 2017
*/
@@ -123,13 +122,11 @@ public LegendInfo build() {
String finalStyleName = styleName == null ? "" : styleName;
// building the legend url
String finalUrl = buildFinalUrl(finalStyleName, finalWidth, finalHeight, finalFormat);
- return new LegendInfo(
- finalStyleName, finalWidth, finalHeight, finalFormat, finalUrl, minScale, maxScale);
+ return new LegendInfo(finalStyleName, finalWidth, finalHeight, finalFormat, finalUrl, minScale, maxScale);
}
/** Helper method that builds the legend get url using the available info. */
- private String buildFinalUrl(
- String finalStyleName, Integer finalWidth, Integer finalHeight, String finalFormat) {
+ private String buildFinalUrl(String finalStyleName, Integer finalWidth, Integer finalHeight, String finalFormat) {
if (completeUrl != null) {
// we have a complete url so let's just return it
return completeUrl;
@@ -156,8 +153,8 @@ private String buildFinalUrl(
}
/**
- * Helper method check's if a quote separating the base url from the query parameters needs to
- * be added to the url or not.
+ * Helper method check's if a quote separating the base url from the query parameters needs to be added to the url
+ * or not.
*/
private String addQuoteMark(String finalUrl) {
if (finalUrl.indexOf("?") == finalUrl.length() - 1) {
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendRawInfo.java b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendRawInfo.java
index fe75050391..9aa3247006 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendRawInfo.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendRawInfo.java
@@ -1,23 +1,19 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Nuno Oliveira, GeoSolutions S.A.S., Copyright 2017
*/
package org.geowebcache.config.legends;
-/**
- * Contains the raw information about a style legend as it may appear in the XML configuration for
- * example.
- */
+/** Contains the raw information about a style legend as it may appear in the XML configuration for example. */
public class LegendRawInfo {
private String style;
@@ -93,16 +89,9 @@ public void setMaxScale(Double maxScale) {
this.maxScale = maxScale;
}
- /**
- * Build the concrete legend information using the provided layer information and defaults
- * values.
- */
+ /** Build the concrete legend information using the provided layer information and defaults values. */
public LegendInfo getLegendInfo(
- String layerName,
- String layerUrl,
- Integer defaultWidth,
- Integer defaultHeight,
- String defaultFormat) {
+ String layerName, String layerUrl, Integer defaultWidth, Integer defaultHeight, String defaultFormat) {
return new LegendInfoBuilder()
.withLayerName(layerName)
.withLayerUrl(layerUrl)
@@ -130,10 +119,8 @@ public boolean equals(Object other) {
if (height != null ? !height.equals(that.height) : that.height != null) return false;
if (format != null ? !format.equals(that.format) : that.format != null) return false;
if (url != null ? !url.equals(that.url) : that.url != null) return false;
- if (completeUrl != null ? !completeUrl.equals(that.completeUrl) : that.completeUrl != null)
- return false;
- if (minScale != null ? !minScale.equals(that.minScale) : that.minScale != null)
- return false;
+ if (completeUrl != null ? !completeUrl.equals(that.completeUrl) : that.completeUrl != null) return false;
+ if (minScale != null ? !minScale.equals(that.minScale) : that.minScale != null) return false;
return maxScale != null ? maxScale.equals(that.maxScale) : that.maxScale == null;
}
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendsRawInfo.java b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendsRawInfo.java
index 5fd9bf651a..30009a6c21 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendsRawInfo.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendsRawInfo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Nuno Oliveira, GeoSolutions S.A.S., Copyright 2017
*/
@@ -61,16 +60,15 @@ public List getLegendsRawInfo() {
}
/**
- * Builds the concrete legends info for each raw legend info using the provided layer
- * information. The returned map index the legend info per layer.
+ * Builds the concrete legends info for each raw legend info using the provided layer information. The returned map
+ * index the legend info per layer.
*/
public Map getLegendsInfo(String layerName, String layerUrl) {
Map legendsInfo = new HashMap<>();
for (LegendRawInfo legendRawInfo : legendsRawInfo) {
legendsInfo.put(
legendRawInfo.getStyle(),
- legendRawInfo.getLegendInfo(
- layerName, layerUrl, defaultWidth, defaultHeight, defaultFormat));
+ legendRawInfo.getLegendInfo(layerName, layerUrl, defaultWidth, defaultHeight, defaultFormat));
}
return legendsInfo;
}
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendsRawInfoConverter.java b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendsRawInfoConverter.java
index 971f086929..eb5b1f3011 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendsRawInfoConverter.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/legends/LegendsRawInfoConverter.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Nuno Oliveira, GeoSolutions S.A.S., Copyright 2017
*/
@@ -24,8 +23,7 @@
public class LegendsRawInfoConverter implements Converter {
@Override
- public void marshal(
- Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
+ public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
LegendsRawInfo legendsRawInfo = (LegendsRawInfo) source;
// encode default values
writer.addAttribute("defaultWidth", String.valueOf(legendsRawInfo.getDefaultWidth()));
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceContact.java b/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceContact.java
index 14412af45a..9b781eac53 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceContact.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceContact.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, OpenGeo, Copyright 2009
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceInformation.java b/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceInformation.java
index d8ebe54457..9cd7a2c980 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceInformation.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceInformation.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, OpenGeo, Copyright 2009
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceProvider.java b/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceProvider.java
index 60d0edd140..5019304f25 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceProvider.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/config/meta/ServiceProvider.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, OpenGeo, Copyright 2009
*/
diff --git a/geowebcache/core/src/main/java/org/geowebcache/controller/GeoWebCacheDispatcherController.java b/geowebcache/core/src/main/java/org/geowebcache/controller/GeoWebCacheDispatcherController.java
index a093edc8af..086ddd8508 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/controller/GeoWebCacheDispatcherController.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/controller/GeoWebCacheDispatcherController.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -39,8 +38,7 @@ public class GeoWebCacheDispatcherController {
private GeoWebCacheDispatcher gwcDispatcher;
@RequestMapping(path = {"", "/home", "/service/**", "/demo/**", "/proxy/**"})
- public void handleRestApiRequest(HttpServletRequest request, HttpServletResponse response)
- throws Exception {
+ public void handleRestApiRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
gwcDispatcher.handleRequest(
new HttpServletRequestWrapper(request) {
@Override
diff --git a/geowebcache/core/src/main/java/org/geowebcache/conveyor/Conveyor.java b/geowebcache/core/src/main/java/org/geowebcache/conveyor/Conveyor.java
index 93fcf446dc..115e4e2a88 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/conveyor/Conveyor.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/conveyor/Conveyor.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -19,9 +18,7 @@
import org.geowebcache.mime.MimeType;
import org.geowebcache.storage.StorageBroker;
-/**
- * Represents a request against a tile service and carries the information needed to complete it.
- */
+/** Represents a request against a tile service and carries the information needed to complete it. */
public abstract class Conveyor {
/** Should the request represented by this conveyor be handled by the service or the layer */
@@ -66,8 +63,7 @@ public static enum CacheResult {
protected CacheResult cacheResult;
- protected Conveyor(
- String layerId, StorageBroker sb, HttpServletRequest srq, HttpServletResponse srp) {
+ protected Conveyor(String layerId, StorageBroker sb, HttpServletRequest srq, HttpServletResponse srp) {
this.layerId = layerId;
storageBroker = sb;
servletReq = srq;
diff --git a/geowebcache/core/src/main/java/org/geowebcache/conveyor/ConveyorTile.java b/geowebcache/core/src/main/java/org/geowebcache/conveyor/ConveyorTile.java
index 0baf3e2c74..4c0bb4b8a9 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/conveyor/ConveyorTile.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/conveyor/ConveyorTile.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
* @author Arne Kepp, The Open Planning Project, Copyright 2009
*/
@@ -60,10 +59,7 @@ public class ConveyorTile extends Conveyor implements TileResponseReceiver {
private boolean isMetaTileCacheOnly;
public ConveyorTile(
- StorageBroker sb,
- String layerId,
- HttpServletRequest servletReq,
- HttpServletResponse servletResp) {
+ StorageBroker sb, String layerId, HttpServletRequest servletReq, HttpServletResponse servletResp) {
super(layerId, sb, servletReq, servletResp);
}
@@ -78,15 +74,7 @@ public ConveyorTile(
Map filteringParameters,
HttpServletRequest servletReq,
HttpServletResponse servletResp) {
- this(
- sb,
- layerId,
- gridSetId,
- tileIndex,
- mimeType,
- filteringParameters,
- servletReq,
- servletResp);
+ this(sb, layerId, gridSetId, tileIndex, mimeType, filteringParameters, servletReq, servletResp);
this.fullParameters = fullParameters;
}
@@ -116,9 +104,7 @@ public ConveyorTile(
this.filteringParameters = filteringParameters;
- stObj =
- TileObject.createQueryTileObject(
- layerId, idx, gridSetId, mimeType.getFormat(), filteringParameters);
+ stObj = TileObject.createQueryTileObject(layerId, idx, gridSetId, mimeType.getFormat(), filteringParameters);
}
public Map getFilteringParameters() {
diff --git a/geowebcache/core/src/main/java/org/geowebcache/demo/Demo.java b/geowebcache/core/src/main/java/org/geowebcache/demo/Demo.java
index 135892dd70..df3d073db8 100644
--- a/geowebcache/core/src/main/java/org/geowebcache/demo/Demo.java
+++ b/geowebcache/core/src/main/java/org/geowebcache/demo/Demo.java
@@ -1,14 +1,13 @@
/**
- * This program is free software: you can redistribute it and/or modify it under the terms of the
- * GNU Lesser General Public License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ *
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
- *
You should have received a copy of the GNU Lesser General Public License along with this
- * program. If not, see .
+ *
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
+ * .
*
*
Copyright 2019
*/
@@ -74,8 +73,7 @@ public static void makeMap(
String rawGridSet = request.getParameter("gridSet");
String gridSetStr = null;
- if (rawGridSet != null)
- gridSetStr = ServletUtils.URLDecode(rawGridSet, request.getCharacterEncoding());
+ if (rawGridSet != null) gridSetStr = ServletUtils.URLDecode(rawGridSet, request.getCharacterEncoding());
if (gridSetStr == null) {
gridSetStr = request.getParameter("srs");
@@ -101,8 +99,7 @@ public static void makeMap(
if (request.getRequestURI().endsWith("/")) {
try {
String reqUri = request.getRequestURI();
- response.sendRedirect(
- response.encodeRedirectURL(reqUri.substring(0, reqUri.length() - 1)));
+ response.sendRedirect(response.encodeRedirectURL(reqUri.substring(0, reqUri.length() - 1)));
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Error sending redirect response", e);
}
@@ -121,8 +118,7 @@ public static void makeMap(
}
}
- private static String generateHTML(
- TileLayerDispatcher tileLayerDispatcher, GridSetBroker gridSetBroker)
+ private static String generateHTML(TileLayerDispatcher tileLayerDispatcher, GridSetBroker gridSetBroker)
throws GeoWebCacheException {
String reloadPath = "rest/reload";
String truncatePath = "rest/masstruncate";
@@ -133,47 +129,43 @@ private static String generateHTML(
buf.append(ServletUtils.gwcHtmlHeader("", "GWC Demos"));
buf.append("
\n");
buf.append(ServletUtils.gwcHtmlLogoLink(""));
- buf.append(
- "