private void CheckVolumeExists() { if (checkValid) { return; } if (User == null || (Path == VolumePath.Home && Image == null)) { return; } switch (Path) { case VolumePath.Data: IOUtils.AddDirectoryIfNotExists(System.IO.Path.Combine(Consts.PublicRootPath, User.Id, "data")); break; case VolumePath.Home: var dir = IOUtils.AddDirectoryIfNotExists(System.IO.Path.Combine(Consts.PublicRootPath, User.Id, Image.Tag)); IOUtils.Copy(new System.IO.DirectoryInfo("/etc/skel"), dir, false); break; case VolumePath.Public: // no necessary to check break; default: return; } checkValid = true; }