Fixed some Windows path issues
This commit is contained in:
@@ -40,7 +40,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (target.Type == SourceItemType.UserCalendar)
|
||||
{
|
||||
_targetUserId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
_targetUserId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
if (!string.IsNullOrWhiteSpace(_targetUserId))
|
||||
_targetCalendarId = await GetDefaultRestoreTargetCalendar(_targetUserId, cancel);
|
||||
}
|
||||
@@ -48,7 +48,7 @@ partial class RestoreProvider
|
||||
{
|
||||
_targetUserId = target.Metadata.GetValueOrDefault("gsuite:UserId");
|
||||
if (string.IsNullOrWhiteSpace(_targetUserId))
|
||||
_targetUserId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
_targetUserId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
_targetCalendarId = target.Metadata.GetValueOrDefault("gsuite:Id");
|
||||
}
|
||||
else
|
||||
|
||||
@@ -35,7 +35,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (target.Type == SourceItemType.UserChat)
|
||||
{
|
||||
_targetUserId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
_targetUserId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
}
|
||||
else if (target.Type == SourceItemType.ChatSpace)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (target.Type == SourceItemType.UserContacts)
|
||||
{
|
||||
_targetUserId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
_targetUserId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (target.Type == SourceItemType.UserDrive)
|
||||
{
|
||||
userId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
userId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -387,7 +387,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (RestoreTarget.Type == SourceItemType.UserDrive)
|
||||
{
|
||||
userId = RestoreTarget.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
userId = RestoreTarget.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
}
|
||||
else if (RestoreTarget.Type == SourceItemType.DriveFolder)
|
||||
{
|
||||
@@ -464,7 +464,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (RestoreTarget.Type == SourceItemType.UserDrive)
|
||||
{
|
||||
userId = RestoreTarget.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
userId = RestoreTarget.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
}
|
||||
else if (RestoreTarget.Type == SourceItemType.DriveFolder)
|
||||
{
|
||||
@@ -684,7 +684,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (RestoreTarget.Type == SourceItemType.UserDrive)
|
||||
{
|
||||
userId = RestoreTarget.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
userId = RestoreTarget.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
}
|
||||
else if (RestoreTarget.Type == SourceItemType.DriveFolder)
|
||||
{
|
||||
|
||||
@@ -40,14 +40,14 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (target.Type == SourceItemType.UserGmail)
|
||||
{
|
||||
_targetUserId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
_targetUserId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
if (string.IsNullOrWhiteSpace(_targetUserId))
|
||||
throw new InvalidOperationException("User ID is not set");
|
||||
_targetLabelId = await GetDefaultRestoreTargetLabel(_targetUserId, cancel);
|
||||
}
|
||||
else if (target.Type == SourceItemType.GmailLabel)
|
||||
{
|
||||
_targetUserId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
_targetUserId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
_targetLabelId = target.Metadata.GetValueOrDefault("gsuite:Id");
|
||||
}
|
||||
else
|
||||
|
||||
@@ -34,7 +34,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (target.Type == SourceItemType.UserKeep)
|
||||
{
|
||||
_targetUserId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
_targetUserId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ partial class RestoreProvider
|
||||
}
|
||||
else if (target.Type == SourceItemType.UserTasks)
|
||||
{
|
||||
_targetUserId = target.Path.TrimStart('/').Split('/').Skip(1).FirstOrDefault();
|
||||
_targetUserId = target.Path.TrimStart(Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Skip(1).FirstOrDefault();
|
||||
}
|
||||
else if (target.Type == SourceItemType.TaskList)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user