cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Min Chen <>
Subject Re: [PROPOSAL] Add getPathSeparator() to
Date Mon, 19 May 2014 16:28:27 GMT
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.


On 5/13/14 10:24 AM, "Damoder Reddy" <> wrote:

>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 +
>            if (!snapshotName.startsWith("VHD-") &&
>!snapshotName.endsWith(".vhd")) {
>                snapshotInstallPath = snapshotInstallPath + ".vhd";
>            }
>            URI snapshotURI = new URI(secondaryStorageUrl +
>File.separator + snapshotInstallPath);
>            String snapshotPath = snapshotURI.getHost() + ":" +
>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

View raw message