First set of changes for direct download. Needs further testing.
* Fixed bug introduced in download change and updated ndn-js (Backport)
Change-Id: I72742322cca6aa7d6e7f4c2b5f90e7035d6e6953
diff --git a/client/convert.js b/client/convert.js
new file mode 100644
index 0000000..efe6c26
--- /dev/null
+++ b/client/convert.js
@@ -0,0 +1,30 @@
+"use strict";
+const fs = require('fs');
+
+const regex = /^Original File Name: ([\w\d-]+\.nc)\s*^NDN Name: (\/(?:[\w\d-]+\/)*)/gm;
+
+fs.readFile('sample_output', 'utf8',function(err, data){
+
+ if (err){
+ return console.error(err);
+ }
+
+ var output = {};
+ for (let match = regex.exec(data); match; match = regex.exec(data)){
+ if (output[match[2]]){
+ console.log("Duplicate found for:", match[2], "|", output[match[2]], "|", match[1]);
+ continue;
+ }
+ output[match[2]] = match[1];
+ }
+
+ console.log("Found", Object.keys(output).length, "conversions.");
+
+ fs.writeFile('conversions.json', JSON.stringify(output), function(err){
+ if (err){
+ return console.error(err);
+ }
+ });
+
+});
+