// Creation of the builder for building a new CoverageStore
CatalogBuilder builder = new CatalogBuilder(getCatalog());
// Definition of the workspace associated to the coverage
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