Skip to content
Snippets Groups Projects
Commit aaf95a05 authored by Olivier Langella's avatar Olivier Langella
Browse files

prevent writing XPIP file to an URL

parent 08e6212a
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,7 @@ public class XtandemPipelineMain {
in = new XpipFile(urlOfXpipData);
logger.info("Starting new main with ProticPort");
new Main_Windows(in);
} catch (IOException e) {
logger.error("unable to open URL "
+ urlOfXpipData.toString());
......
......@@ -50,11 +50,13 @@ public class XpipFile {
}
public XpipFile(URL urlOfXpipData) {
logger.debug("urlOfXpipData " + urlOfXpipData.toString());
if (urlOfXpipData.getProtocol().equals("file")) {
File test = new File(urlOfXpipData.getFile());
if (test.exists()) {
xpipFile = test;
urlOfXpipData = null;
logger.debug("xpipFile " + xpipFile.getAbsolutePath());
return;
}
}
......@@ -88,6 +90,13 @@ public class XpipFile {
XtandemPipelineSession session) throws Exception {
save_project save = new save_project(session.getIdentificationList(),
session.getDataTypeBase(), save_result_and_filtering);
if (xpipFile == null) {
String message = "Unable to write XPIP data to an URL ("
+ urlOfXpipData.toString()
+ "). Try \"Save project as\" instead.";
logger.debug(message);
throw new MSMSException(message);
}
save.write_data_to(xpipFile);
this.modified = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment