@ -264,7 +264,7 @@ func (l *b2Objects) ListObjects(bucket string, prefix string, marker string, del
Name : file . Name ,
Name : file . Name ,
ModTime : file . Timestamp ,
ModTime : file . Timestamp ,
Size : file . Size ,
Size : file . Size ,
ETag : file . Info . ID ,
ETag : toS3ETag ( file . Info . ID ) ,
ContentType : file . Info . ContentType ,
ContentType : file . Info . ContentType ,
UserDefined : file . Info . Info ,
UserDefined : file . Info . Info ,
} )
} )
@ -299,7 +299,7 @@ func (l *b2Objects) ListObjectsV2(bucket, prefix, continuationToken, delimiter s
Name : file . Name ,
Name : file . Name ,
ModTime : file . Timestamp ,
ModTime : file . Timestamp ,
Size : file . Size ,
Size : file . Size ,
ETag : file . Info . ID ,
ETag : toS3ETag ( file . Info . ID ) ,
ContentType : file . Info . ContentType ,
ContentType : file . Info . ContentType ,
UserDefined : file . Info . Info ,
UserDefined : file . Info . Info ,
} )
} )
@ -346,7 +346,7 @@ func (l *b2Objects) GetObjectInfo(bucket string, object string) (objInfo ObjectI
objInfo = ObjectInfo {
objInfo = ObjectInfo {
Bucket : bucket ,
Bucket : bucket ,
Name : object ,
Name : object ,
ETag : fi . ID ,
ETag : toS3ETag ( fi . ID ) ,
Size : fi . Size ,
Size : fi . Size ,
ModTime : fi . Timestamp ,
ModTime : fi . Timestamp ,
ContentType : fi . ContentType ,
ContentType : fi . ContentType ,
@ -452,7 +452,7 @@ func (l *b2Objects) PutObject(bucket string, object string, data *h2.Reader, met
return ObjectInfo {
return ObjectInfo {
Bucket : bucket ,
Bucket : bucket ,
Name : object ,
Name : object ,
ETag : fi . ID ,
ETag : toS3ETag ( fi . ID ) ,
Size : fi . Size ,
Size : fi . Size ,
ModTime : fi . Timestamp ,
ModTime : fi . Timestamp ,
ContentType : fi . ContentType ,
ContentType : fi . ContentType ,
@ -566,7 +566,7 @@ func (l *b2Objects) PutObjectPart(bucket string, object string, uploadID string,
return PartInfo {
return PartInfo {
PartNumber : partID ,
PartNumber : partID ,
LastModified : UTCNow ( ) ,
LastModified : UTCNow ( ) ,
ETag : sha1 ,
ETag : toS3ETag ( sha1 ) ,
Size : data . Size ( ) ,
Size : data . Size ( ) ,
} , nil
} , nil
}
}
@ -597,7 +597,7 @@ func (l *b2Objects) ListObjectParts(bucket string, object string, uploadID strin
for _ , part := range partsList {
for _ , part := range partsList {
lpi . Parts = append ( lpi . Parts , PartInfo {
lpi . Parts = append ( lpi . Parts , PartInfo {
PartNumber : part . Number ,
PartNumber : part . Number ,
ETag : part . SHA1 ,
ETag : toS3ETag ( part . SHA1 ) ,
Size : part . Size ,
Size : part . Size ,
} )
} )
}
}
@ -627,7 +627,9 @@ func (l *b2Objects) CompleteMultipartUpload(bucket string, object string, upload
if i + 1 != uploadedPart . PartNumber {
if i + 1 != uploadedPart . PartNumber {
return oi , b2ToObjectError ( traceError ( InvalidPart { } ) , bucket , object , uploadID )
return oi , b2ToObjectError ( traceError ( InvalidPart { } ) , bucket , object , uploadID )
}
}
hashes [ uploadedPart . PartNumber ] = uploadedPart . ETag
// Trim "-1" suffix in ETag as PutObjectPart() treats B2 returned SHA1 as ETag.
hashes [ uploadedPart . PartNumber ] = strings . TrimSuffix ( uploadedPart . ETag , "-1" )
}
}
if _ , err = bkt . File ( uploadID , object ) . CompileParts ( 0 , hashes ) . FinishLargeFile ( l . ctx ) ; err != nil {
if _ , err = bkt . File ( uploadID , object ) . CompileParts ( 0 , hashes ) . FinishLargeFile ( l . ctx ) ; err != nil {