git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
05e9add
)
simple escape utility class for JAL-1023 patch
author
jprocter
<jprocter@compbio.dundee.ac.uk>
Thu, 8 Dec 2011 11:42:18 +0000
(11:42 +0000)
committer
jprocter
<jprocter@compbio.dundee.ac.uk>
Thu, 8 Dec 2011 11:42:18 +0000
(11:42 +0000)
src/jalview/util/Platform.java
patch
|
blob
|
history
diff --git
a/src/jalview/util/Platform.java
b/src/jalview/util/Platform.java
index
392f1f9
..
ad9a9b7
100644
(file)
--- a/
src/jalview/util/Platform.java
+++ b/
src/jalview/util/Platform.java
@@
-51,4
+51,23
@@
public class Platform
// TODO: determine nominal limits for most platforms.
\r
return 2046; // this is the max length for a windows NT system.
\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
}
\r