@Component public class GeoServerRESTImporter extends Object
| Constructor and Description |
|---|
GeoServerRESTImporter() |
GeoServerRESTImporter(String importerBaseURL,
String username,
String password)
Constructs a new importer with values set.
|
| Modifier and Type | Method and Description |
|---|---|
protected URI |
addEndPoint(String endPoint)
Add an endpoint.
|
static File |
addPrjFileToArchive(File file,
String targetCrs)
Add a projection file to a shapefile zip archive.
|
protected String |
asJSON(Object entity)
Convert an object to json.
|
boolean |
createGdalAddOverviewTask(Integer importJobId,
Integer importTaskId,
List<String> opts,
List<Integer> levels)
Create and append importer task for
gdaladdo |
boolean |
createGdalTranslateTask(Integer importJobId,
Integer importTaskId,
List<String> optsGdalTranslate)
Create and append importer task for
gdal_translate |
boolean |
createGdalWarpTask(Integer importJobId,
Integer importTaskId,
List<String> optsGdalWarp)
Create and append importer task for
gdalwarp |
RESTImport |
createImportJob(String workSpaceName,
String dataStoreName)
Create a new import job.
|
boolean |
createReprojectTransformTask(Integer importJobId,
Integer taskId,
String sourceSrs,
String targetSrs)
Create a reprojection task.
|
boolean |
deleteImportJob(Integer importJobId)
Deletes an importJob.
|
List<RESTLayer> |
getAllImportedLayers(Integer importJobId,
List<RESTImportTask> tasks)
fetch all created Layers of import job
|
RESTData |
getDataOfImportTask(Integer importJobId,
Integer taskId)
Get the data of an import task.
|
RESTLayer |
getLayer(Integer importJobId,
Integer taskId)
Get a layer.
|
RESTImportTask |
getRESTImportTask(Integer importJobId,
Integer taskId)
Get an import task.
|
RESTImportTaskList |
getRESTImportTasks(Integer importJobId) |
boolean |
runImportJob(Integer importJobId)
Run a previously configured import job.
|
static String |
toSingleLineWKT(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Turns the CRS into a single line WKT
|
boolean |
updateImportTask(int importJobId,
int importTaskId,
AbstractRESTEntity updateTaskEntity)
Updates the given import task.
|
boolean |
updateLayerForImportTask(int importJobId,
int importTaskId,
AbstractRESTEntity updateTaskEntity)
Update layer object for a given task of an import job (via PUT)
|
RESTImportTaskList |
uploadFile(Integer importJobId,
File file,
String sourceSrs)
Upload an import file.
|
public GeoServerRESTImporter()
public GeoServerRESTImporter(String importerBaseURL, String username, String password) throws URISyntaxException
URISyntaxExceptionpublic static File addPrjFileToArchive(File file, String targetCrs) throws net.lingala.zip4j.exception.ZipException, IOException, org.opengis.referencing.FactoryException
net.lingala.zip4j.exception.ZipExceptionIOExceptionorg.opengis.referencing.FactoryExceptionpublic static String toSingleLineWKT(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
crs - CoordinateReferenceSystem which should be formattedpublic RESTImport createImportJob(String workSpaceName, String dataStoreName) throws Exception
Exceptionpublic boolean createReprojectTransformTask(Integer importJobId, Integer taskId, String sourceSrs, String targetSrs) throws URISyntaxException, org.apache.http.HttpException
URISyntaxExceptionorg.apache.http.HttpExceptionpublic boolean createGdalAddOverviewTask(Integer importJobId, Integer importTaskId, List<String> opts, List<Integer> levels) throws URISyntaxException, org.apache.http.HttpException
gdaladdoURISyntaxExceptionorg.apache.http.HttpExceptionpublic boolean createGdalWarpTask(Integer importJobId, Integer importTaskId, List<String> optsGdalWarp) throws URISyntaxException, org.apache.http.HttpException
gdalwarpURISyntaxExceptionorg.apache.http.HttpExceptionpublic boolean createGdalTranslateTask(Integer importJobId, Integer importTaskId, List<String> optsGdalTranslate) throws URISyntaxException, org.apache.http.HttpException
gdal_translateURISyntaxExceptionorg.apache.http.HttpExceptionpublic RESTImportTaskList uploadFile(Integer importJobId, File file, String sourceSrs) throws Exception
Exceptionpublic boolean updateImportTask(int importJobId,
int importTaskId,
AbstractRESTEntity updateTaskEntity)
throws Exception
Exceptionpublic boolean updateLayerForImportTask(int importJobId,
int importTaskId,
AbstractRESTEntity updateTaskEntity)
throws URISyntaxException,
org.apache.http.HttpException
importJobId - The import job IDimportTaskId - The import task IDupdateTaskEntity - The entity to use for updateURISyntaxExceptionorg.apache.http.HttpExceptionpublic boolean deleteImportJob(Integer importJobId) throws URISyntaxException, org.apache.http.HttpException
URISyntaxExceptionorg.apache.http.HttpExceptionpublic boolean runImportJob(Integer importJobId) throws UnsupportedEncodingException, URISyntaxException, org.apache.http.HttpException
UnsupportedEncodingExceptionURISyntaxExceptionorg.apache.http.HttpExceptionpublic RESTLayer getLayer(Integer importJobId, Integer taskId) throws Exception
Exceptionpublic List<RESTLayer> getAllImportedLayers(Integer importJobId, List<RESTImportTask> tasks) throws Exception
Exceptionpublic RESTData getDataOfImportTask(Integer importJobId, Integer taskId) throws Exception
Exceptionpublic RESTImportTask getRESTImportTask(Integer importJobId, Integer taskId) throws Exception
Exceptionpublic RESTImportTaskList getRESTImportTasks(Integer importJobId) throws Exception
importJobId - Exceptionprotected URI addEndPoint(String endPoint) throws URISyntaxException
URISyntaxExceptionCopyright © 2020 terrestris GmbH & Co. KG. All rights reserved.