@@ -109,7 +109,7 @@ public AttachAnswer attachIso(AttachCommand cmd) {
109109 return new AttachAnswer ("Can't attach a iso which is not created on nfs: " );
110110 }
111111 NfsTO nfsStore = (NfsTO ) store ;
112- isoURL = nfsStore .getUrl () + File . separator + data .getPath ();
112+ isoURL = nfsStore .getUrl () + nfsStore . getPathSeparator () + data .getPath ();
113113 }
114114
115115 String vmName = cmd .getVmName ();
@@ -290,7 +290,7 @@ public Answer dettachIso(DettachCommand cmd) {
290290 return new AttachAnswer ("Can't attach a iso which is not created on nfs: " );
291291 }
292292 NfsTO nfsStore = (NfsTO ) store ;
293- isoURL = nfsStore .getUrl () + File . separator + data .getPath ();
293+ isoURL = nfsStore .getUrl () + nfsStore . getPathSeparator () + data .getPath ();
294294 }
295295
296296 try {
@@ -933,7 +933,7 @@ public Answer copyVolumeFromImageCacheToPrimary(CopyCommand cmd) {
933933 SR primaryStoragePool = hypervisorResource .getStorageRepository (conn , destVolume .getDataStore ().getUuid ());
934934 String srUuid = primaryStoragePool .getUuid (conn );
935935 URI uri = new URI (nfsStore .getUrl ());
936- String volumePath = uri .getHost () + ":" + uri .getPath () + File . separator + srcVolume .getPath ();
936+ String volumePath = uri .getHost () + ":" + uri .getPath () + nfsStore . getPathSeparator () + srcVolume .getPath ();
937937 String uuid = copy_vhd_from_secondarystorage (conn , volumePath , srUuid , wait );
938938 VolumeObjectTO newVol = new VolumeObjectTO ();
939939 newVol .setPath (uuid );
@@ -970,15 +970,15 @@ public Answer copyVolumeFromPrimaryToSecondary(CopyCommand cmd) {
970970 }
971971
972972 // Create a SR for the volume UUID folder
973- secondaryStorage = hypervisorResource .createNfsSRbyURI (conn , new URI (nfsStore .getUrl () + File . separator + destVolume .getPath ()), false );
973+ secondaryStorage = hypervisorResource .createNfsSRbyURI (conn , new URI (nfsStore .getUrl () + nfsStore . getPathSeparator () + destVolume .getPath ()), false );
974974 // Look up the volume on the source primary storage pool
975975 VDI srcVdi = getVDIbyUuid (conn , srcVolume .getPath ());
976976 // Copy the volume to secondary storage
977977 VDI destVdi = hypervisorResource .cloudVDIcopy (conn , srcVdi , secondaryStorage , wait );
978978 String destVolumeUUID = destVdi .getUuid (conn );
979979
980980 VolumeObjectTO newVol = new VolumeObjectTO ();
981- newVol .setPath (destVolume .getPath () + File . separator + destVolumeUUID + ".vhd" );
981+ newVol .setPath (destVolume .getPath () + nfsStore . getPathSeparator () + destVolumeUUID + ".vhd" );
982982 newVol .setSize (srcVolume .getSize ());
983983 return new CopyCmdAnswer (newVol );
984984 } catch (Exception e ) {
@@ -1282,7 +1282,7 @@ public Answer backupSnapshot(CopyCommand cmd) {
12821282 }
12831283 // finalPath = folder + File.separator + snapshotBackupUuid;
12841284 } else {
1285- finalPath = folder + File . separator + snapshotBackupUuid ;
1285+ finalPath = folder + cacheStore . getPathSeparator () + snapshotBackupUuid ;
12861286 }
12871287
12881288 } finally {
@@ -1310,7 +1310,7 @@ public Answer backupSnapshot(CopyCommand cmd) {
13101310 String [] tmp = results .split ("#" );
13111311 snapshotBackupUuid = tmp [1 ];
13121312 physicalSize = Long .parseLong (tmp [2 ]);
1313- finalPath = folder + File . separator + snapshotBackupUuid ;
1313+ finalPath = folder + cacheStore . getPathSeparator () + snapshotBackupUuid ;
13141314 }
13151315 }
13161316 // delete primary snapshots with only the last one left
@@ -1461,13 +1461,13 @@ public Answer createVolumeFromSnapshot(CopyCommand cmd) {
14611461 }
14621462 // Get the absolute path of the snapshot on the secondary storage.
14631463 String snapshotInstallPath = snapshot .getPath ();
1464- int index = snapshotInstallPath .lastIndexOf (File . separator );
1464+ int index = snapshotInstallPath .lastIndexOf (nfsImageStore . getPathSeparator () );
14651465 String snapshotName = snapshotInstallPath .substring (index + 1 );
14661466
14671467 if (!snapshotName .startsWith ("VHD-" ) && !snapshotName .endsWith (".vhd" )) {
14681468 snapshotInstallPath = snapshotInstallPath + ".vhd" ;
14691469 }
1470- URI snapshotURI = new URI (secondaryStorageUrl + File . separator + snapshotInstallPath );
1470+ URI snapshotURI = new URI (secondaryStorageUrl + nfsImageStore . getPathSeparator () + snapshotInstallPath );
14711471 String snapshotPath = snapshotURI .getHost () + ":" + snapshotURI .getPath ();
14721472 String srUuid = primaryStorageSR .getUuid (conn );
14731473 volumeUUID = copy_vhd_from_secondarystorage (conn , snapshotPath , srUuid , wait );
0 commit comments