Skip to content

Commit

Permalink
Added servicenet to config options and setStorageUrl function
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwood committed Nov 18, 2011
1 parent d33378c commit a89350f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/cloudfiles/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ var Config = exports.Config = function (options) {

var cachePath = path.join(this.cache.path, this.auth.username);
this.cache.path = options.cache ? options.cache.cachePath || cachePath : cachePath;

this.servicenet = options.servicenet === true;
};

Config.prototype = {
Expand All @@ -50,7 +52,22 @@ Config.prototype = {
},
cache: {
path: path.join(__dirname, '..', '..', '.cache')
},
servicenet: false
};

//
// ### function setStorageUrl (storageUrl)
// ### @storageUrl {string} Rackspace Cloudfiles storage URL
// Sets the storage URL for this instance, updating to the Serive Net URL if
// Service Net transfer has been specified.
Config.prototype.setStorageUrl = function(storageUrl) {
if (this.servicenet === true) {
this.storageUrl = storageUrl.replace('https://', 'https://snet-');
} else {
this.storageUrl = storageUrl;
}
};



0 comments on commit a89350f

Please sign in to comment.