diff --git a/src/java/com/threerings/presents/tools/GenReceiverTask.java b/src/java/com/threerings/presents/tools/GenReceiverTask.java index c48c88f8f..b62b60ece 100644 --- a/src/java/com/threerings/presents/tools/GenReceiverTask.java +++ b/src/java/com/threerings/presents/tools/GenReceiverTask.java @@ -122,7 +122,7 @@ public class GenReceiverTask extends InvocationTask // determine the path to our sender file String mpath = source.getPath(); mpath = StringUtil.replace(mpath, "Receiver", "Sender"); - mpath = StringUtil.replace(mpath, "/client/", "/server/"); + mpath = replacePath(mpath, "/client/", "/server/"); writeFile(mpath, sw.toString()); diff --git a/src/java/com/threerings/presents/tools/GenServiceTask.java b/src/java/com/threerings/presents/tools/GenServiceTask.java index b0056effa..ef0089362 100644 --- a/src/java/com/threerings/presents/tools/GenServiceTask.java +++ b/src/java/com/threerings/presents/tools/GenServiceTask.java @@ -186,7 +186,7 @@ public class GenServiceTask extends InvocationTask // determine the path to our marshaller file String mpath = source.getPath(); mpath = StringUtil.replace(mpath, "Service", "Marshaller"); - mpath = StringUtil.replace(mpath, "/client/", "/data/"); + mpath = replacePath(mpath, "/client/", "/data/"); writeFile(mpath, sw.toString()); @@ -229,7 +229,7 @@ public class GenServiceTask extends InvocationTask // determine the path to our marshaller file String mpath = source.getPath(); mpath = StringUtil.replace(mpath, "Service", "Dispatcher"); - mpath = StringUtil.replace(mpath, "/client/", "/server/"); + mpath = replacePath(mpath, "/client/", "/server/"); writeFile(mpath, sw.toString()); @@ -269,7 +269,7 @@ public class GenServiceTask extends InvocationTask // determine the path to our provider file String mpath = source.getPath(); mpath = StringUtil.replace(mpath, "Service", "Provider"); - mpath = StringUtil.replace(mpath, "/client/", "/server/"); + mpath = replacePath(mpath, "/client/", "/server/"); writeFile(mpath, sw.toString()); diff --git a/src/java/com/threerings/presents/tools/InvocationTask.java b/src/java/com/threerings/presents/tools/InvocationTask.java index fccf6f66f..9c0a81138 100644 --- a/src/java/com/threerings/presents/tools/InvocationTask.java +++ b/src/java/com/threerings/presents/tools/InvocationTask.java @@ -315,6 +315,14 @@ public abstract class InvocationTask extends Task return (didx == -1) ? name : name.substring(0, didx); } + protected static String replacePath ( + String source, String oldstr, String newstr) + { + return StringUtil.replace(source, + oldstr.replace('/', File.separatorChar), + newstr.replace('/', File.separatorChar)); + } + /** A list of filesets that contain tile images. */ protected ArrayList _filesets = new ArrayList();