/*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)\r
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
// TODO: determine nominal limits for most platforms.\r
return 2046; // this is the max length for a windows NT system.\r
}\r
+\r
+ /**\r
+ * escape a string according to the local platform's escape character\r
+ * @param file\r
+ * @return escaped file\r
+ */\r
+ public static String escapeString(String file)\r
+ {\r
+ StringBuffer f=new StringBuffer();\r
+ int p=0,lastp=0;\r
+ while ((p=file.indexOf('\\',lastp))>-1)\r
+ {\r
+ f.append(file.subSequence(lastp,p));\r
+ f.append("\\\\");\r
+ lastp=p+1;\r
+ }\r
+ f.append(file.substring(lastp));\r
+ return f.toString();\r
+ }\r
}\r