Skip to content
Snippets Groups Projects
Commit 766b36fc authored by gmantele's avatar gmantele
Browse files

[UWS] Fix JobInfo destruction when no file associated

parent 3f246d19
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ package uws.job.jobInfo; ...@@ -16,7 +16,7 @@ package uws.job.jobInfo;
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with UWSLibrary. If not, see <http://www.gnu.org/licenses/>. * along with UWSLibrary. If not, see <http://www.gnu.org/licenses/>.
* *
* Copyright 2017-2019 - Astronomisches Rechen Institut (ARI), * Copyright 2017-2020 - Astronomisches Rechen Institut (ARI),
* UDS/Centre de Données astronomiques de Strasbourg (CDS) * UDS/Centre de Données astronomiques de Strasbourg (CDS)
*/ */
...@@ -142,7 +142,7 @@ import uws.service.request.UploadFile; ...@@ -142,7 +142,7 @@ import uws.service.request.UploadFile;
* </p> * </p>
* *
* @author Gr&eacute;gory Mantelet (ARI;CDS) * @author Gr&eacute;gory Mantelet (ARI;CDS)
* @version 4.4 (03/2019) * @version 4.5 (05/2020)
* @since 4.2 * @since 4.2
*/ */
public class XMLJobInfo implements JobInfo { public class XMLJobInfo implements JobInfo {
...@@ -323,12 +323,14 @@ public class XMLJobInfo implements JobInfo { ...@@ -323,12 +323,14 @@ public class XMLJobInfo implements JobInfo {
@Override @Override
public void destroy() throws UWSException { public void destroy() throws UWSException {
if (file != null) {
try { try {
file.deleteFile(); file.deleteFile();
} catch(IOException ioe) { } catch(IOException ioe) {
throw new UWSException(UWSException.INTERNAL_SERVER_ERROR, ioe, "Error when deleting a JobInfo file!"); throw new UWSException(UWSException.INTERNAL_SERVER_ERROR, ioe, "Error when deleting a JobInfo file!");
} }
} }
}
/** /**
* Serialize this {@link XMLJobInfo}. * Serialize this {@link XMLJobInfo}.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment