The proposal looks ok to me. But it may involve several changes in our code base, some places in our code we even used hard-coded separator instead of using constants. With this change, some global cleanup needs to be done to make sure that it will not bring regressions.
Thanks -min On 5/13/14 10:24 AM, "Damoder Reddy" <damoder.re...@citrix.com> wrote: >Hi, > >While working on windowsfication of management server, I found the issues >when creating a template from a ROOT disk snapshot. >It is not able to create template out of that snapshot due to the >snapshot path we are constructing before creating template is using >³File.Separator² and on windows it would be ³\² instead of ³/². Due to >this the template creation is failing from snapshot when management >server is running on windows. > >Code snippet example is > >String snapshotInstallPath = snapshot.getPath(); > int index = snapshotInstallPath.lastIndexOf(File.separator); > String snapshotName = snapshotInstallPath.substring(index + >1); > > if (!snapshotName.startsWith("VHD-") && >!snapshotName.endsWith(".vhd")) { > snapshotInstallPath = snapshotInstallPath + ".vhd"; > } > URI snapshotURI = new URI(secondaryStorageUrl + >File.separator + snapshotInstallPath); > String snapshotPath = snapshotURI.getHost() + ":" + >snapshotURI.getPath(); > >To fix this problem I am proposing the following solution. > >The path separator is specific to the file system(NFS, samba etc..) we >are using as a secondary storage on SSVM. Instead of using File.separator >in the path, we can add a method say ³getPathSeparator()² to >³DataStoreTO.java² which is implemented by several file systems. And we >will replace ³File.separator² with the above method call at all >respective places. > >Anybody see any problems or any other better approach can think of here? > >Is this the only place we need to do changes or any other places also >changes are required to achieve this? > >Thanks & Regards >Damodar/ >