/
GSCoverageStoreManager.R
563 lines (534 loc) · 25.4 KB
/
GSCoverageStoreManager.R
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
#' Geoserver REST API CoverageStore Manager
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords geoserver rest api CoverageStore
#' @return Object of \code{\link{R6Class}} with methods for managing GeoServer
#' CoverageStores (i.e. stores of coverage data)
#' @format \code{\link{R6Class}} object.
#'
#' @examples
#' \dontrun{
#' GSCoverageStoreManager$new("http://localhost:8080/geoserver", "admin", "geoserver")
#' }
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
GSCoverageStoreManager <- R6Class("GSCoverageStoreManager",
inherit = GSManager,
public = list(
#CoverageStore generic CRUD methods
#===========================================================================
#'@description Get the list of available coverage stores. Returns an object of class \code{list}
#' giving items of class \code{\link{GSAbstractCoverageStore}}
#'@param ws workspace name
#'@return the list of coverage stores
getCoverageStores = function(ws){
msg = sprintf("Fetching list of coverage stores in workspace '%s'", ws)
cli::cli_alert_info(msg)
self$INFO(msg)
req <- GSUtils$GET(
self$getUrl(), private$user, private$keyring_backend$get(service = private$keyring_service, username = private$user),
sprintf("/workspaces/%s/coveragestores.xml", ws),
verbose = self$verbose.debug)
covList <- NULL
if(status_code(req) == 200){
covXML <- GSUtils$parseResponseXML(req)
covXMLList <- as(xml2::xml_find_all(covXML, "//coverageStore"), "list")
covList <- lapply(covXMLList, function(xml){
covType <- xml2::xml_find_first(xml, "//type") %>% xml2::xml_text()
coverageStore <- switch(covType,
"GeoTIFF" = GSGeoTIFFCoverageStore$new(xml = xml),
"WorldImage" = GSWorldImageCoverageStore$new(xml = xml),
"ImageMosaic" = GSImageMosaicCoverageStore$new(xml = xml),
"ArcGrid" = GSArcGridCoverageStore$new(xml = xml),
GSAbstractCoverageStore$new(xml = xml)
)
return(coverageStore)
})
msg = sprintf("Successfully fetched %s coverage stores!", length(covList))
cli::cli_alert_success(msg)
self$INFO(msg)
}else{
err = "Error while fetching list of datastores"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(covList)
},
#'@description Get the list of available coverage store names. Returns an vector of class \code{character}
#'@param ws workspace name
#'@return the list of coverage store names, as \code{character}
getCoverageStoreNames = function(ws){
covList <- sapply(self$getCoverageStores(ws), function(x){x$name})
return(covList)
},
#'@description Get an object of class \code{\link{GSAbstractDataStore}} given a workspace and coverage store names.
#'@param ws workspace name
#'@param cs coverage store name
#'@return the coverage store
getCoverageStore = function(ws, cs){
msg = sprintf("Fetching coverage store '%s' in workspace '%s'", cs, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
req <- GSUtils$GET(
self$getUrl(), private$user, private$keyring_backend$get(service = private$keyring_service, username = private$user),
sprintf("/workspaces/%s/coveragestores/%s.xml", ws, cs),
verbose = self$verbose.debug)
coverageStore <- NULL
if(status_code(req) == 200){
covXML <- GSUtils$parseResponseXML(req)
covType <- xml2::xml_find_first(covXML, "//type") %>% xml2::xml_text()
coverageStore <- switch(covType,
"GeoTIFF" = GSGeoTIFFCoverageStore$new(xml = covXML),
"WorldImage" = GSWorldImageCoverageStore$new(xml = covXML),
"ImageMosaic" = GSImageMosaicCoverageStore$new(xml = covXML),
"ArcGrid" = GSArcGridCoverageStore$new(xml = covXML),
GSAbstractCoverageStore$new(xml = covXML)
)
msg = "Successfully fetched coverage store!"
cli::cli_alert_success(msg)
self$INFO(msg)
}else{
err = "Error while fetching coverage store"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(coverageStore)
},
#'@description Creates a new coverage store given a workspace, coverage store name. Abstract method used in below format-specific
#' methods to create coverage stores.
#'@param ws workspace name
#'@param coverageStore coverage store object
#'@return \code{TRUE} if created, \code{FALSE} otherwise
createCoverageStore = function(ws, coverageStore){
msg = sprintf("Creating coverage store '%s' in workspace '%s'", coverageStore$name, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
created <- FALSE
if(is.null(coverageStore$workspace)) coverageStore$workspace <- ws
req <- GSUtils$POST(
url = self$getUrl(),
user = private$user,
pwd = private$keyring_backend$get(service = private$keyring_service, username = private$user),
path = sprintf("/workspaces/%s/coveragestores.xml", ws),
content = GSUtils$getPayloadXML(coverageStore),
contentType = "application/xml",
verbose = self$verbose.debug
)
if(status_code(req) == 201){
msg = "Successfully created coverage store!"
cli::cli_alert_success(msg)
self$INFO(msg)
created = TRUE
}else{
err = "Error while creating coverage store"
cli::cli_alert_danger(err)
self$ERROR(err)
}
},
#'@description Updates a coverage store given a workspace, coverage store name. Abstract method used in below format-specific
#' methods to create coverage stores.
#'@param ws workspace name
#'@param coverageStore coverage store object
#'@return \code{TRUE} if updated, \code{FALSE} otherwise
updateCoverageStore = function(ws, coverageStore){
if(is.null(coverageStore$workspace)) coverageStore$workspace <- ws
updated <- FALSE
msg = sprintf("Updating coverage store '%s' in workspace '%s'", coverageStore$name, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
req <- GSUtils$PUT(
url = self$getUrl(), user = private$user, pwd = private$keyring_backend$get(service = private$keyring_service, username = private$user),
path = sprintf("/workspaces/%s/coveragestores/%s.xml", ws, coverageStore$name),
content = GSUtils$getPayloadXML(coverageStore),
contentType = "application/xml",
verbose = self$verbose.debug
)
if(status_code(req) == 200){
msg = "Successfully updated coverage store!"
cli::cli_alert_success(msg)
self$INFO(msg)
updated = TRUE
}else{
err = "Error while updating coverage store"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(updated)
},
#'@description Deletes a coverage store given a workspace and an object of class \code{\link{GSAbstractCoverageStore}}.
#' By defaut, the option \code{recurse} is set to FALSE, ie datastore layers are not removed.
#' To remove all coverage store layers, set this option to TRUE. The \code{purge} parameter is used
#' to customize the delete of files on disk (in case the underlying reader implements a delete method).
#' It can take one of the three values: none, metadata, all. For more details see \url{https://docs.geoserver.org/stable/en/user/rest/api/coveragestores.html#purge}
#'@param ws workspace name
#'@param cs coverage store name
#'@param recurse recurse
#'@param purge purge
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
deleteCoverageStore = function(ws, cs, recurse = FALSE, purge = NULL){
msg = sprintf("Deleting coverage store '%s' in workspace '%s'", cs, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
deleted <- FALSE
path <- sprintf("/workspaces/%s/coveragestores/%s.xml", ws, cs)
if(recurse) path <- paste0(path, "?recurse=true")
if(!is.null(purge)){
allowedPurgeValues <- c("none","metadata","all")
if(!(purge %in% allowedPurgeValues)){
err = sprintf("Purge value should be among allowed purge values [%s]",
paste(allowedPurgeValues, collapse=","))
cli::cli_alert_danger(err)
stop(err)
}
path <- paste0(path, ifelse(recurse,"&","?"), "purge=", purge)
}
req <- GSUtils$DELETE(self$getUrl(), private$user, private$keyring_backend$get(service = private$keyring_service, username = private$user),
path = path, verbose = self$verbose.debug)
if(status_code(req) == 200){
msg = "Successfully deleted coverage store!"
cli::cli_alert_success(msg)
self$INFO(msg)
deleted = TRUE
}else{
err = "Error while deleting coverage store"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(deleted)
},
#CoverageStore coverages CRUD methods
#===========================================================================
#'@description Get the list of available coverages for given workspace and coverage store.
#' Returns an object of class \code{list} giving items of class \code{\link{GSCoverage}}
#'@param ws workspace name
#'@param cs coverage store name
#'@return the list of \link{GSCoverage}
getCoverages = function(ws, cs){
msg = sprintf("Fetching coverages for coverage store '%s' in workspace '%s'", cs, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
req <- GSUtils$GET(
self$getUrl(), private$user,
private$keyring_backend$get(service = private$keyring_service, username = private$user),
sprintf("/workspaces/%s/coveragestores/%s/coverages.xml", ws, cs),
verbose = self$verbose.debug)
covList <- NULL
if(status_code(req) == 200){
covXML <- GSUtils$parseResponseXML(req)
covXMLList <- as(xml2::xml_find_all(covXML, "//coverages/coverage"), "list")
covList <- lapply(covXMLList, GSCoverage$new)
msg = sprintf("Successfully fetched %s coverages!", length(covList))
cli::cli_alert_success(msg)
self$INFO(msg)
}else{
err = "Error while fetching list of coverages"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(covList)
},
#'@description Get the list of available coverage names for given workspace and coverage store.
#' Returns an object of class \code{list} giving items of class \code{\link{GSCoverage}}
#'@param ws workspace name
#'@param cs coverage store name
#'@return the list of coverage names
getCoverageNames = function(ws, cs){
covList <- sapply(self$getCoverages(ws, cs), function(x){x$name})
return(covList)
},
#'@description Get coverage
#'@param ws workspace name
#'@param cs coverage store name
#'@param cv coverage name
getCoverage = function(ws, cs, cv){
msg = sprintf("Fetching coverage '%s' in coverage store '%s' (workspace '%s')", cv, cs, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
req <- GSUtils$GET(
self$getUrl(), private$user,
private$keyring_backend$get(service = private$keyring_service, username = private$user),
sprintf("/workspaces/%s/coveragestores/%s/coverages/%s.xml", ws, cs, cv),
verbose = self$verbose.debug)
coverage <- NULL
if(status_code(req) == 200){
covXML <- GSUtils$parseResponseXML(req)
coverage <- GSCoverage$new(xml = covXML)
msg = "Successfully fetched coverage!"
cli::cli_alert_success(msg)
self$INFO(msg)
}else{
err = "Error while fetching coverage"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(coverage)
},
#'@description Creates a new coverage given a workspace, coverage store names and an object of class \code{\link{GSCoverage}}
#'@param ws workspace name
#'@param cs coverage store name
#'@param coverage object of class \link{GSCoverage}
#'@return \code{TRUE} if created, \code{FALSE} otherwise
createCoverage = function(ws, cs, coverage){
msg = sprintf("Creating coverage '%s' in coverage store '%s' (workspace '%s')", coverage$name, cs, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
created <- FALSE
req <- GSUtils$POST(
url = self$getUrl(),
user = private$user,
pwd = private$keyring_backend$get(service = private$keyring_service, username = private$user),
path = sprintf("/workspaces/%s/coveragestores/%s/coverages.xml", ws, cs),
content = GSUtils$getPayloadXML(coverage),
contentType = "application/xml",
verbose = self$verbose.debug
)
if(status_code(req) == 201){
msg = "Successfully created coverage!"
cli::cli_alert_success(msg)
self$INFO(msg)
created = TRUE
}else{
err = "Error while creating coverage"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(created)
},
#'@description Updates a coverage given a workspace, coverage store names and an object of class \code{\link{GSCoverage}}
#'@param ws workspace name
#'@param cs coverage store name
#'@param coverage object of class \link{GSCoverage}
#'@return \code{TRUE} if updated, \code{FALSE} otherwise
updateCoverage = function(ws, cs, coverage){
msg = sprintf("Updating coverage '%s' in coverage store '%s' (workspace '%s')", coverage$name, cs, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
updated <- FALSE
req <- GSUtils$PUT(
url = self$getUrl(), user = private$user,
pwd = private$keyring_backend$get(service = private$keyring_service, username = private$user),
path = sprintf("/workspaces/%s/coveragestores/%s/coverages/%s.xml",
ws, cs, coverage$name),
content = GSUtils$getPayloadXML(coverage),
contentType = "application/xml",
verbose = self$verbose.debug
)
if(status_code(req) == 200){
msg = "Successfully updated coverage!"
cli::cli_alert_success(msg)
self$INFO(msg)
updated = TRUE
}else{
err = "Error while updating coverage"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(updated)
},
#'@description Deletes a coverage given a workspace, coverage store names, and an object of
#' class \code{\link{GSCoverage}}. By defaut, the option \code{recurse} is
#' set to FALSE, ie coverage layers are not removed.
#'@param ws workspace name
#'@param cs coverage store name
#'@param cv coverage name
#'@param recurse recurse
deleteCoverage = function(ws, cs, cv, recurse = FALSE){
msg = sprintf("Deleting coverage '%s' in coverage '%s' (workspace '%s')", cv, cs, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
deleted <- FALSE
path <- sprintf("/workspaces/%s/coveragestores/%s/coverages/%s.xml", ws, cs, cv)
if(recurse) path <- paste0(path, "?recurse=true")
req <- GSUtils$DELETE(self$getUrl(), private$user,
private$keyring_backend$get(service = private$keyring_service, username = private$user),
path = path, verbose = self$verbose.debug)
if(status_code(req) == 200){
msg = "Successfuly deleted coverage!"
cli::cli_alert_success(msg)
self$INFO(msg)
deleted = TRUE
}else{
err = "Error while deleting coverage"
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(deleted)
},
#Upload methods
#===========================================================================
#'@description Abstract method to upload a coverage file targeting a workspace (\code{ws}) and datastore (\code{cs}). The \code{extension}
#' corresponds to the format/type of coverage to be uploaded (among values 'geotiff', 'worldimage', 'arcgrid', or 'imagemosaic').
#' The \code{endpoint} takes a value among \code{"file"} (default), \code{"url"} or \code{"external"}. The \code{filename} is the name
#' of the coverage file to upload and set for the newly created datastore. The \code{configure} parameter can take a value among values
#' \code{"none"} (indicates to configure only the datastore but no layer configuration) or \code{"first"} (configure
#' both datastore and layer). The \code{update} defines the strategy for the upload: \code{"append"} (default value) for
#' the first upload, \code{"overwrite"} in case the file should be overwriten.
#'@param ws workspace name
#'@param cs coverage store name
#'@param endpoint endpoint. Default is "file"
#'@param extension extension
#'@param filename filename
#'@param configure configure. Default is "first"
#'@param update update. Default is "append"
#'@param contentType content type
#'@return \code{TRUE} if uploaded, \code{FALSE} otherwise
uploadCoverage = function(ws, cs,
endpoint = "file", extension, filename,
configure = "first", update = "append",
contentType){
msg = sprintf("Uploading %s coverage in new datastore '%s' (workspace '%s')",
toupper(extension), cs, ws)
cli::cli_alert_info(msg)
self$INFO(msg)
uploaded <- FALSE
supportedEndpoints <- c("file","url","external")
if(!(endpoint %in% supportedEndpoints)){
err = sprintf("Unsupported endpoint '%s'. Possible values: [%s]",
endpoint, paste0(supportedEndpoints, collapse=","))
cli::cli_alert_danger(err)
self$ERROR(err)
stop(err)
}
supportedExtensions <- c("geotiff", "worldimage", "imagemosaic", "arcgrid")
if(!(extension %in% supportedExtensions)){
err = sprintf("Unsupported extension '%s'. Possible values: [%s]",
extension, paste0(supportedExtensions, collapse=","))
cli::cli_alert_danger(err)
self$ERROR(err)
stop(err)
}
supportedConfigurations <- c("first", "none", "all")
if(!(configure %in% supportedConfigurations)){
err = sprintf("Unsupported configure parameter '%s'. Possible values: [%s]",
configure, paste0(supportedConfigurations, collapse=","))
cli::cli_alert_danger(err)
self$ERROR(err)
stop(err)
}
supportedUpdates <- c("append","overwrite")
if(!(update %in% supportedUpdates)){
err = sprintf("Unsupported update parameter '%s'. Possible values: [%s]",
update, paste0(supportedUpdates, collapse=","))
cli::cli_alert_danger(err)
self$ERROR(err)
stop(err)
}
req <- GSUtils$PUT(
url = self$getUrl(), user = private$user, pwd = private$keyring_backend$get(service = private$keyring_service, username = private$user),
path = sprintf("/workspaces/%s/coveragestores/%s/%s.%s?configure=%s&update=%s",
ws, cs, endpoint, extension, configure, update),
content = NULL,
filename = filename,
contentType = contentType,
verbose = self$verbose.debug
)
if(status_code(req) == 201){
msg = "Successfull coverage upload!"
cli::cli_alert_success(msg)
self$INFO(msg)
uploaded = TRUE
}
if(!uploaded){
err = sprintf("Error while uploading coverage: %s", http_status(req)$message)
cli::cli_alert_danger(err)
self$ERROR(err)
}
return(uploaded)
},
#'@description Uploads a GeoTIFF file targeting a workspace (\code{ws}) and datastore (\code{cs}). The \code{endpoint} takes a value among
#' \code{"file"} (default), \code{"url"} or \code{"external"}. The \code{filename} is the name of the GeoTIFF file to
#' upload and set for the newly created datastore. The \code{configure} parameter can take a value among values
#' \code{"none"} (indicates to configure only the datastore but no layer configuration) or \code{"first"} (configure
#' both datastore and layer). The \code{update} defines the strategy for the upload: \code{"append"} (default value) for
#' the first upload, \code{"overwrite"} in case the file should be overwriten.
#'@param ws workspace name
#'@param cs coverage store name
#'@param endpoint endpoint. Default is "file"
#'@param filename filename
#'@param configure configure. Default is "first"
#'@param update update. Default is "append"
#'@return \code{TRUE} if uploaded, \code{FALSE} otherwise
uploadGeoTIFF = function(ws, cs,
endpoint = "file", filename,
configure = "first", update = "append"){
return(self$uploadCoverage(
ws = ws, cs = cs,
endpoint = endpoint, extension = "geotiff", filename = filename,
configure = configure, update = update,
contentType = "text/plain"
))
},
#'@description Uploads a WorldImage file targeting a workspace (\code{ws}) and datastore (\code{cs}). The \code{endpoint} takes a value among
#' \code{"file"} (default), \code{"url"} or \code{"external"}. The \code{filename} is the name of the zipped file to
#' upload and set for the newly created datastore. It is assumed the zip archive contains the .prj file to set the SRS.
#' The \code{configure} parameter can take a value among values \code{"none"} (indicates to configure only the datastore
#' but no layer configuration) or \code{"first"} (configure both datastore and layer). The \code{update} defines the strategy
#' for the upload: \code{"append"} (default value) for the first upload, \code{"overwrite"} in case the file should be overwriten.
#'@param ws workspace name
#'@param cs coverage store name
#'@param endpoint endpoint. Default is "file"
#'@param filename filename
#'@param configure configure. Default is "first"
#'@param update update. Default is "append"
#'@return \code{TRUE} if uploaded, \code{FALSE} otherwise
uploadWorldImage = function(ws, cs,
endpoint = "file", filename,
configure = "first", update = "append"){
return(self$uploadCoverage(
ws = ws, cs = cs,
endpoint = endpoint, extension = "worldimage", filename = filename,
configure = configure, update = update,
contentType = "application/zip"
))
},
#'@description Uploads an ArcGrid file targeting a workspace (\code{ws}) and datastore (\code{cs}). The \code{endpoint} takes a value among
#' \code{"file"} (default), \code{"url"} or \code{"external"}. The \code{filename} is the name of the ArcGrid file to
#' upload and set for the newly created datastore. The \code{configure} parameter can take a value among values
#' \code{"none"} (indicates to configure only the datastore but no layer configuration) or \code{"first"} (configure
#' both datastore and layer). The \code{update} defines the strategy for the upload: \code{"append"} (default value) for
#' the first upload, \code{"overwrite"} in case the file should be overwriten.
#'@param ws workspace name
#'@param cs coverage store name
#'@param endpoint endpoint. Default is "file"
#'@param filename filename
#'@param configure configure. Default is "first"
#'@param update update. Default is "append"
#'@return \code{TRUE} if uploaded, \code{FALSE} otherwise
uploadArcGrid = function(ws, cs,
endpoint = "file", filename,
configure = "first", update = "append"){
return(self$uploadCoverage(
ws = ws, cs = cs,
endpoint = endpoint, extension = "arcgrid", filename = filename,
configure = configure, update = update,
contentType = "text/plain"
))
},
#'@description Uploads an ImageMosaic file targeting a workspace (\code{ws}) and datastore (\code{cs}). The \code{endpoint} takes a value among
#' \code{"file"} (default), \code{"url"} or \code{"external"}. The \code{filename} is the name of the ImageMosaic file to
#' upload and set for the newly created datastore. The \code{configure} parameter can take a value among values
#' \code{"none"} (indicates to configure only the datastore but no layer configuration) or \code{"first"} (configure
#' both datastore and layer). The \code{update} defines the strategy for the upload: \code{"append"} (default value) for
#' the first upload, \code{"overwrite"} in case the file should be overwriten.
#'@param ws workspace name
#'@param cs coverage store name
#'@param endpoint endpoint. Default is "file"
#'@param filename filename
#'@param configure configure. Default is "first"
#'@param update update. Default is "append"
#'@return \code{TRUE} if uploaded, \code{FALSE} otherwise
uploadImageMosaic = function(ws, cs,
endpoint = "file", filename,
configure = "first", update = "append"){
return(self$uploadCoverage(
ws = ws, cs = cs,
endpoint = endpoint, extension = "imagemosaic", filename = filename,
configure = configure, update = update,
contentType = "application/zip"
))
}
)
)