// 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