MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / fixPath

Method fixPath

ij/src/main/java/ij/plugin/frame/Recorder.java:205–219  ·  view source on GitHub ↗

Replaces '\' characters with '/'.

(String path)

Source from the content-addressed store, hash-verified

203
204 /** Replaces '\' characters with '/'. */
205 public static String fixPath (String path) {
206 if (path==null)
207 path = "";
208 if (!IJ.isWindows())
209 return path;
210 StringBuilder sb = new StringBuilder();
211 for (int i=0; i<path.length(); i++) {
212 char c=path.charAt(i);
213 if (c=='\\')
214 sb.append("/");
215 else
216 sb.append(c);
217 }
218 return new String(sb);
219 }
220
221 /** Replaces special characters in a String for creation of a quoted macro String. Does not add quotes. */
222 public static String fixString (String str) {

Callers 11

runMethod · 0.95
runMethod · 0.95
showDialogMethod · 0.95
runMethod · 0.95
multiCropMethod · 0.95
recordMethod · 0.95
recordOpenMethod · 0.95
recordPathMethod · 0.95
openAllMethod · 0.95
openImageMethod · 0.95
dropMethod · 0.95

Calls 4

isWindowsMethod · 0.95
charAtMethod · 0.80
lengthMethod · 0.65
appendMethod · 0.65

Tested by

no test coverage detected