Bitzsoft.Integrations.CloudDrive.Nutstore 1.0.0-alpha.8

This is a prerelease version of Bitzsoft.Integrations.CloudDrive.Nutstore.
dotnet add package Bitzsoft.Integrations.CloudDrive.Nutstore --version 1.0.0-alpha.8
                    
NuGet\Install-Package Bitzsoft.Integrations.CloudDrive.Nutstore -Version 1.0.0-alpha.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitzsoft.Integrations.CloudDrive.Nutstore" Version="1.0.0-alpha.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.CloudDrive.Nutstore" Version="1.0.0-alpha.8" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.CloudDrive.Nutstore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitzsoft.Integrations.CloudDrive.Nutstore --version 1.0.0-alpha.8
                    
#r "nuget: Bitzsoft.Integrations.CloudDrive.Nutstore, 1.0.0-alpha.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitzsoft.Integrations.CloudDrive.Nutstore@1.0.0-alpha.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitzsoft.Integrations.CloudDrive.Nutstore&version=1.0.0-alpha.8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.CloudDrive.Nutstore&version=1.0.0-alpha.8&prerelease
                    
Install as a Cake Tool

Bitzsoft.Integrations.CloudDrive.Nutstore

坚果云企业网盘服务实现,基于 WebDAV 协议与坚果云服务端交互。

功能

  • 基于 WebDAV 协议实现文件上传、下载、移动、复制、删除等基础操作
  • 支持文件夹创建、列举、删除
  • 支持 NSDAV XML API 搜索、创建分享链接、文件夹 ACL 权限管理
  • 认证方式:邮箱 + 应用专用密码(HTTP Basic Auth)
  • 统一异常处理,WebDAV 错误自动映射为 CloudDriveException

安装

dotnet add package Bitzsoft.Integrations.CloudDrive.Nutstore
<PackageReference Include="Bitzsoft.Integrations.CloudDrive.Nutstore" Version="*" />

配置

{
  "CloudDrive": {
    "Nutstore": {
      "AuthEmail": "your-email@example.com",
      "AuthPassword": "your-app-password",
      "BaseUrl": "https://dav.jianguoyun.com/dav/",
      "RestApiUrl": "https://api.jianguoyun.com/v2/",
      "HttpClientName": "NutstoreCloudDrive"
    }
  }
}
参数 必填 默认值 说明
AuthEmail 坚果云账号邮箱
AuthPassword 应用专用密码(非登录密码)
BaseUrl https://dav.jianguoyun.com/dav/ WebDAV 服务基地址
RestApiUrl https://api.jianguoyun.com/v2/ REST API 基地址
HttpClientName NutstoreCloudDrive 命名 HttpClient 名称

注册

// 方式一:Action 配置
services.AddBitzsoftNutstoreCloudDrive(options =>
{
    options.AuthEmail = "your-email@example.com";
    options.AuthPassword = "your-app-password";
});

// 方式二:IConfiguration 绑定
services.AddBitzsoftNutstoreCloudDrive(configuration, "CloudDrive:Nutstore");

第三方请求日志

内置 Bitzsoft.Integrations.RequestLogging 出站请求记录管道,默认 NullRequestLogStore 不持久化。

// ① 默认:启用记录管道但不持久化(日志丢弃)
services.AddBitzsoftNutstoreCloudDrive(options => { /* ... */ });

// ② 持久化:宿主注册 IRequestLogStore 实现后,所有出站请求自动落库
services.AddRequestLogging<MyRequestLogStore>(opts =>
{
    opts.MaxBodyLength = 8192;            // 单条正文截断上限
    opts.SensitiveFields.Add("mySecret"); // 额外脱敏字段
});
services.AddBitzsoftNutstoreCloudDrive(options => { /* ... */ });

使用示例

public class MyService
{
    private readonly ICloudDriveProvider _cloudDrive;

    public MyService(ICloudDriveProvider cloudDrive) => _cloudDrive = cloudDrive;

    public async Task UploadAndListAsync()
    {
        // 上传文件
        await using var stream = File.OpenRead("report.pdf");
        var uploadResult = await _cloudDrive.UploadAsync(new UploadFileRequest
        {
            FolderId = "/documents",
            FileName = "report.pdf",
            Content = stream,
            ContentType = "application/pdf"
        });

        // 列出文件夹内容
        var files = await _cloudDrive.ListFilesAsync("/documents");
        foreach (var file in files.Items)
        {
            Console.WriteLine($"{file.Name} ({file.Size} bytes)");
        }

        // 下载文件
        var downloadStream = await _cloudDrive.DownloadAsync("/documents/report.pdf");
    }
}

实现状态

方法 协议 状态 说明
UploadAsync WebDAV PUT 已实现 上传文件
DownloadAsync WebDAV GET 已实现 下载文件
DeleteFileAsync WebDAV DELETE 已实现 删除文件
MoveFileAsync WebDAV MOVE 已实现 移动文件
CopyFileAsync WebDAV COPY 已实现 复制文件
GetFileInfoAsync WebDAV PROPFIND 已实现 获取文件元数据
ListFilesAsync WebDAV PROPFIND 已实现 客户端分页
CreateFolderAsync WebDAV MKCOL 已实现 创建文件夹
DeleteFolderAsync WebDAV DELETE 已实现 删除文件夹
SearchAsync NSDAV XML 已实现 POST /nsdav/search,客户端分页/筛选
CreateShareLinkAsync NSDAV XML 已实现 POST /nsdav/pubObject;公开接口不支持密码和过期时间
DeleteShareLinkAsync 不支持 公开 API 手册未提供删除共享链接接口
GetPermissionsAsync NSDAV XML 已实现 POST /nsdav/getSandboxAcl,仅适用于文件夹 ACL
SetPermissionAsync NSDAV XML 已实现 POST /nsdav/updateSandboxAcl,读取当前 ACL 后替换/追加
DeletePermissionAsync NSDAV XML 已实现 POST /nsdav/updateSandboxAcl,读取当前 ACL 后移除
ListVersionsAsync 不支持 公开 API 手册未提供历史版本列表接口
DownloadVersionAsync 不支持 公开 API 手册未提供指定历史版本下载接口
RestoreVersionAsync 不支持 公开 API 手册未提供历史版本恢复接口

注意事项

  • WebDAV 协议不支持服务端搜索和分页,ListFilesAsync 采用客户端分页
  • SearchAsync 使用 NSDAV 搜索接口,分页和类型/扩展名筛选在客户端完成
  • 分享链接创建接口不支持访问密码、过期时间或最大访问次数
  • 权限管理接口会提交完整 ACL 列表,封装会先读取再替换/移除目标权限
  • fileIdfolderId 均为 WebDAV 相对路径(如 /documents/report.pdf
  • 应用密码需在坚果云 Web 端「安全选项」中生成第三方应用专用密码
  • 文件夹 ID 以路径形式表示,根目录使用 /

依赖

  • Bitzsoft.Integrations.CloudDrive,企业网盘抽象层
  • Bitzsoft.Integrations.Compatibility,基础工具库

相关包

包名 说明
Bitzsoft.Integrations.CloudDrive 抽象层
Bitzsoft.Integrations.Compatibility 基础工具库
Bitzsoft.Integrations.CloudDrive.Nutstore 坚果云
Bitzsoft.Integrations.CloudDrive.Microsoft365 Microsoft 365
Bitzsoft.Integrations.CloudDrive.Gokuai 够快云库
Bitzsoft.Integrations.CloudDrive.AnyShare 爱数 AnyShare
Bitzsoft.Integrations.CloudDrive.Baidu 百度网盘
Bitzsoft.Integrations.CloudDrive.Aliyun 阿里云网盘 PDS
Bitzsoft.Integrations.CloudDrive.All 聚合包
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.CloudDrive.Nutstore:

Package Downloads
Bitzsoft.Integrations.CloudDrive.All

企业网盘服务聚合包 — 包含所有供应商实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.8 40 7/1/2026
1.0.0-alpha.7 58 6/16/2026
1.0.0-alpha.6 57 6/16/2026
1.0.0-alpha.5 57 6/14/2026
1.0.0-alpha.4 35 7/1/2026
1.0.0-alpha.3 56 6/7/2026