@@ -412,16 +412,18 @@ BucketManager.prototype.unimage = function (bucket, callbackFunc) {
412
412
rpc . postWithoutForm ( requestURI , digest , callbackFunc ) ;
413
413
} ;
414
414
415
- // 获取指定前缀的文件列表
416
- // @link https://developer.qiniu.com/kodo/api/1284/list
417
- //
418
- // @param bucket 空间名称
419
- // @param options 列举操作的可选参数
420
- // prefix 列举的文件前缀
421
- // marker 上一次列举返回的位置标记,作为本次列举的起点信息
422
- // limit 每次返回的最大列举文件数量
423
- // delimiter 指定目录分隔符
424
- // @param callbackFunc(err, respBody, respInfo) - 回调函数
415
+ /**
416
+ * 获取指定前缀的文件列表
417
+ * @link https://developer.qiniu.com/kodo/api/1284/list
418
+ *
419
+ * @param { string } bucket 空间名称
420
+ * @param { Object } options 列举操作的可选参数
421
+ * @param { string } options.prefix 列举的文件前缀
422
+ * @param { string } options.marker 上一次列举返回的位置标记,作为本次列举的起点信息
423
+ * @param { number } options.limit 每次返回的最大列举文件数量
424
+ * @param { string } options.delimiter 指定目录分隔符
425
+ * @param { function } callbackFunc(err, respBody, respInfo) 回调函数
426
+ */
425
427
BucketManager . prototype . listPrefix = function ( bucket , options , callbackFunc ) {
426
428
util . prepareZone ( this , this . mac . accessKey , bucket , function ( err , ctx ) {
427
429
if ( err ) {
@@ -432,10 +434,10 @@ BucketManager.prototype.listPrefix = function (bucket, options, callbackFunc) {
432
434
} ) ;
433
435
} ;
434
436
435
- function listPrefixReq ( mac , config , bucket , options , callbackFunc ) {
437
+ function listPrefixReq ( mac , config , bucket , options , callbackFunc ) {
436
438
options = options || { } ;
437
439
// 必须参数
438
- var reqParams = {
440
+ const reqParams = {
439
441
bucket : bucket
440
442
} ;
441
443
@@ -463,9 +465,9 @@ function listPrefixReq(mac, config, bucket, options, callbackFunc) {
463
465
reqParams . delimiter = '' ;
464
466
}
465
467
466
- var scheme = config . useHttpsDomain ? 'https://' : 'http://' ;
467
- var reqSpec = querystring . stringify ( reqParams ) ;
468
- var requestURI = scheme + config . zone . rsfHost + '/list?' + reqSpec ;
468
+ const scheme = config . useHttpsDomain ? 'https://' : 'http://' ;
469
+ const reqSpec = querystring . stringify ( reqParams ) ;
470
+ const requestURI = scheme + config . zone . rsfHost + '/list?' + reqSpec ;
469
471
470
472
rpc . postWithOptions (
471
473
requestURI ,
@@ -477,15 +479,19 @@ function listPrefixReq(mac, config, bucket, options, callbackFunc) {
477
479
) ;
478
480
}
479
481
480
- // 获取指定前缀的文件列表
481
- //
482
- // @param bucket 空间名称
483
- // @param options 列举操作的可选参数
484
- // prefix 列举的文件前缀
485
- // marker 上一次列举返回的位置标记,作为本次列举的起点信息
486
- // limit 每次返回的最大列举文件数量
487
- // delimiter 指定目录分隔符
488
- // @param callbackFunc(err, respBody, respInfo) - 回调函数
482
+ /**
483
+ * 获取指定前缀的文件列表 V2
484
+ *
485
+ * @deprecated API 可能返回仅包含 marker,不包含 item 或 dir 的项,请使用 {@link listPrefix}
486
+ *
487
+ * @param bucket 空间名称
488
+ * @param { Object } options 列举操作的可选参数
489
+ * @param { string } options.prefix 列举的文件前缀
490
+ * @param { string } options.marker 上一次列举返回的位置标记,作为本次列举的起点信息
491
+ * @param { number } options.limit 每次返回的最大列举文件数量
492
+ * @param { string } options.delimiter 指定目录分隔符
493
+ * @param { function } callbackFunc(err, respBody, respInfo) 回调函数
494
+ */
489
495
BucketManager . prototype . listPrefixV2 = function ( bucket , options , callbackFunc ) {
490
496
util . prepareZone ( this , this . mac . accessKey , bucket , function ( err , ctx ) {
491
497
if ( err ) {
@@ -496,10 +502,10 @@ BucketManager.prototype.listPrefixV2 = function (bucket, options, callbackFunc)
496
502
} ) ;
497
503
} ;
498
504
499
- function listPrefixReqV2 ( mac , config , bucket , options , callbackFunc ) {
505
+ function listPrefixReqV2 ( mac , config , bucket , options , callbackFunc ) {
500
506
options = options || { } ;
501
507
// 必须参数
502
- var reqParams = {
508
+ const reqParams = {
503
509
bucket : bucket
504
510
} ;
505
511
@@ -527,9 +533,9 @@ function listPrefixReqV2(mac, config, bucket, options, callbackFunc) {
527
533
reqParams . delimiter = '' ;
528
534
}
529
535
530
- var scheme = config . useHttpsDomain ? 'https://' : 'http://' ;
531
- var reqSpec = querystring . stringify ( reqParams ) ;
532
- var requestURI = scheme + config . zone . rsfHost + '/v2/list?' + reqSpec ;
536
+ const scheme = config . useHttpsDomain ? 'https://' : 'http://' ;
537
+ const reqSpec = querystring . stringify ( reqParams ) ;
538
+ const requestURI = scheme + config . zone . rsfHost + '/v2/list?' + reqSpec ;
533
539
534
540
rpc . postWithOptions (
535
541
requestURI ,
0 commit comments