Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
fixes #123
Browse files Browse the repository at this point in the history
  • Loading branch information
arafato committed Nov 30, 2017
1 parent 0548c54 commit 50e58eb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
30 changes: 30 additions & 0 deletions lib/actions/blob/ListBlobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,36 @@ class ListBlobs {
} else {
this._addMetadata(modelBlob, blob.original.metaProps);
}
if (blob.original.snapshot) {
modelBlob.Snapshot = blob.original.snapshotDate;
} else {
delete modelBlob.Snapshot;
}
if (blob.original.copyId) {
modelBlob.Properties.CopyId = blob.original.copyId;
modelBlob.Properties.CopyStatus = blob.original.copyStatus;
modelBlob.Properties.CopySource = blob.original.copySource;
modelBlob.Properties.CopyProgress = blob.original.copyProgress;
modelBlob.Properties.CopyCompletionTime = blob.original.copyCompletionTime;
blob.original.copyStatusDescription
? modelBlob.Properties.CopyStatusDescription = blob.original.copyStatusDescription
: delete modelBlob.Properties.CopyStatusDescription;
} else {
delete modelBlob.Properties.CopyId;
delete modelBlob.Properties.CopyStatus;
delete modelBlob.Properties.CopySource;
delete modelBlob.Properties.CopyProgress;
delete modelBlob.Properties.CopyCompletionTime;
delete modelBlob.Properties.CopyStatusDescription;
}

this.CopyId;
this.CopyStatus;
this.CopySource;
this.CopyProgress;
this.CopyCompletionTime;
this.CopyStatusDescription;

modelBlob.Properties['Last-Modified'] = blob.lastModified();
modelBlob.Properties['Etag'] = blob.original.etag
modelBlob.Properties['Content-Type'] = blob.original.contentType ? blob.original.contentType : {};
Expand Down
9 changes: 7 additions & 2 deletions lib/xml/blob/BlobListXmlModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class BlobList {
class Blob {
constructor(name, blobType) {
this.Name = name;
// Snapshot feature has not been implemented yet
// this.Snapshot = '';
this.Snapshot;
this.Properties = new Properties(blobType);
this.Metadata = {};
}
Expand All @@ -42,6 +41,12 @@ class Properties {
this.LeaseState = 'available';
this.LeaseDuration = 'infinite';
this.ServerEncrypted = false;
this.CopyId;
this.CopyStatus;
this.CopySource;
this.CopyProgress;
this.CopyCompletionTime;
this.CopyStatusDescription;
}
}

Expand Down

0 comments on commit 50e58eb

Please sign in to comment.