[Geoserver-devel] [JIRA] (GEOS-8794) [Community Backup & Restore] Local Resource Finder on Restore does not check if File is null

Alessio Fabiani created an issue

GeoServer / BugGEOS-8794

[Community Backup & Restore] Local Resource Finder on Restore does not check if File is null

Issue Type:

BugBug

Affects Versions:

2.14-beta, 2.13.1

Assignee:

Alessio Fabiani

Components:

Backup and Restore, Community modules

Created:

21/Jun/18 2:40 PM

Fix Versions:

2.14-beta, 2.13.2

Priority:

MediumMedium

Reporter:

Alessio Fabiani

During a Restore, when looking for plugins specific configurations, while trying to replace the target tile GeoServer task looks for any already existing resource of the same type

Resource rstConfigFile = Files.asResource(resourceLoader.find(
Paths.path(
configFile.file().getParentFile().getName(),
configFile.file().getName())));

If it already exists, it replaces it, otherwise it just write the new configuration file.

The issue pops up if the resource does not exist, find returns NULL (the most of the times).

In that case the asResource method just throws an exception, breaking the whole process.

Solutions is simple, we should check that .file does not return a null path.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100087-sha1:2bba7fe)

Atlassian logo