Commit 766b36fc authored by gmantele's avatar gmantele
Browse files

[UWS] Fix JobInfo destruction when no file associated

parent 3f246d19
Loading
Loading
Loading
Loading
+32 −30
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ package uws.job.jobInfo;
 * You should have received a copy of the GNU Lesser General Public License
 * 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)
 */

@@ -142,7 +142,7 @@ import uws.service.request.UploadFile;
 * </p>
 *
 * @author Gr&eacute;gory Mantelet (ARI;CDS)
 * @version 4.4 (03/2019)
 * @version 4.5 (05/2020)
 * @since 4.2
 */
public class XMLJobInfo implements JobInfo {
@@ -323,12 +323,14 @@ public class XMLJobInfo implements JobInfo {

	@Override
	public void destroy() throws UWSException {
		if (file != null) {
			try {
				file.deleteFile();
			} catch(IOException ioe) {
				throw new UWSException(UWSException.INTERNAL_SERVER_ERROR, ioe, "Error when deleting a JobInfo file!");
			}
		}
	}

	/**
	 * Serialize this {@link XMLJobInfo}.