BetterCms.Core.Services.Storage.FileSystemStorageService.ObjectExists C# (CSharp) Method

ObjectExists() public method

public ObjectExists ( Uri uri ) : bool
uri System.Uri
return bool
        public bool ObjectExists(Uri uri)
        {
            CheckUri(uri);
                        
            return File.Exists(uri.LocalPath) || Directory.Exists(uri.LocalPath);
        }

Usage Example

 public void Should_Check_That_File_Not_Exists()
 {
     FileSystemStorageService storageService = new FileSystemStorageService();
     string filePath = Path.Combine(@"C:\", "temp", Guid.NewGuid().ToString().Replace("-", string.Empty) + ".test");
     Uri fileUri = new Uri(filePath);
     storageService.ObjectExists(fileUri);
 }
All Usage Examples Of BetterCms.Core.Services.Storage.FileSystemStorageService::ObjectExists