WorkspaceInfo ws = getCatalog().getWorkspaceByName("gs");
// Creation of a CoverageStore
CoverageStoreInfo store = builder.buildCoverageStore("watertemp4");
store.setURL(DataUtilities.fileToURL(mosaic).toExternalForm());
store.setWorkspace(ws);
ImageMosaicFormat imageMosaicFormat = new ImageMosaicFormat();
store.setType((imageMosaicFormat.getName()));
// Addition to the catalog
getCatalog().add(store);
builder.setStore(store);
// Input reader used for reading the mosaic folder
GridCoverage2DReader reader = null;
// Reader used for checking if the mosaic has been configured correctly
StructuredGridCoverage2DReader reader2 = null;
try {
// Selection of the reader to use for the mosaic
reader = (GridCoverage2DReader) imageMosaicFormat.getReader(DataUtilities
.fileToURL(mosaic));
// configure the coverage
configureCoverageInfo(builder, store, reader);