pkgcloud-with-arm
Version:
An infrastructure-as-a-service agnostic cloud library for node.js
28 lines (22 loc) • 756 B
JavaScript
/*
* container.js: Azure File (Blob)
*
* (C) Microsoft Open Technologies, Inc.
*
*/
var util = require('util'),
_ = require('lodash'),
base = require('../../core/storage/file');
var File = exports.File = function File(client, details) {
base.File.call(this, client, details);
};
util.inherits(File, base.File);
File.prototype._setProperties = function (details) {
this.name = details.name;
this.size = details.contentLength ? parseInt(details.contentLength, 10) : 0;
this.lastModified = new Date(details.lastModified || null);
this.contentType = details.contentSettings && details.contentSettings.contentType;
};
File.prototype.toJSON = function () {
return _.pick(this, ['name', 'size', 'lastModified', 'contentType' ]);
};