Changeset 6d955a
- Timestamp:
- Sep 27, 2014, 4:32:05 PM (6 years ago)
- Branches:
- ng_0.9
- Children:
- fc272b
- Parents:
- 54ce49
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/vI_rdfDatasource.js
r54ce49 r6d955a 58 58 _rdfDataSource : null, 59 59 _rdfFileName : null, 60 _rdfDelimiter : null, 60 61 _rdfNS : "http://virtual-id.absorb.it/", 61 62 _rdfNSStorage : "vIStorage", … … 125 126 .getService(Components.interfaces.nsIProperties) 126 127 .get("ProfD", Components.interfaces.nsIFile); 127 var delimiter = (file.path.match(/\\/))?"\\":"/";128 128 129 // Log.debug("_openRdfDataSource"); 129 130 try { 130 newFile.initWithPath(file.path + delimiter + this._rdfFileName); 131 Log.debug("Filename try linux delimiter: '" + file.path + "/" + this._rdfFileName + "'"); 132 newFile.initWithPath(file.path + "/" + this._rdfFileName); 133 // Log.debug("success"); 134 this._rdfDelimiter = "/"; 131 135 } catch (NS_ERROR_FILE_UNRECOGNIZED_PATH) { 132 var debugMsg = "Filename not valid: '" + file.path + delimiter + this._rdfFileName + "'\n" + 133 "Virtual Identity Storage won't work.\n\n" + 134 "Please report this issue with filename on https://www.absorb.it/virtual-id\n\n" + 135 "You can just copy the lines below in your browser to create a ticket\n\n" + 136 "https://www.absorb.it/virtual-id/newticket?summary=RDF Filename Error&description=Filename " + file.path + delimiter + this._rdfFileName + " for rdf not valid" 137 get3PaneWindow().alert(debugMsg); 138 log.debug("Filename not valid: '" + file.path + delimiter + this._rdfFileName + "'"); 139 log.debug("can't open rdfDatasource - storage won't work"); 140 return; 136 try { 137 Log.debug("Filename try windows delimiter: '" + file.path + "\\" + this._rdfFileName + "'"); 138 newFile.initWithPath(file.path + "\\" + this._rdfFileName); 139 // Log.debug("success"); 140 this._rdfDelimiter = "\\"; 141 } 142 catch (NS_ERROR_FILE_UNRECOGNIZED_PATH) { 143 Log.debug("Filename not valid: '" + file.path + "[\\/]" + this._rdfFileName + "'"); 144 Log.debug("can't open rdfDatasource - storage won't work"); 145 var debugMsg = "Filename not valid: '" + file.path + "\\" + this._rdfFileName + "'\n" + 146 "Filename not valid: '" + file.path + "/" + this._rdfFileName + "'\n" + 147 "Virtual Identity Storage won't work.\n\n" + 148 "Please report this issue with filename on https://www.absorb.it/virtual-id\n\n" + 149 "You can just copy the lines below in your browser to create a ticket\n\n" + 150 "https://www.absorb.it/virtual-id/newticket?summary=RDF Filename Error&description=Filename " + file.path + "[\\/]" + this._rdfFileName + " for rdf not valid" 151 get3PaneWindow().alert(debugMsg); 152 return; 153 } 141 154 } 142 155 var fileURI = protoHandler.newFileURI(newFile); … … 577 590 var file = Components.classes["@mozilla.org/file/directory_service;1"] 578 591 .getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile); 579 var delimiter = (file.path.match(/\\/))?"\\":"/"; 580 rdfDataFile.initWithPath(file.path + delimiter + rdfFileName); 592 rdfDataFile.initWithPath(file.path + this._rdfDelimiter + rdfFileName); 581 593 582 594 rdfDataFile.copyTo(filePicker.file.parent,filePicker.file.leafName); … … 1139 1151 var file = Components.classes["@mozilla.org/file/directory_service;1"] 1140 1152 .getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile); 1141 var delimiter = (file.path.match(/\\/))?"\\":"/"; 1142 importRdfDataFile.initWithPath(file.path + delimiter + this._rdfFileName + "_import"); 1153 importRdfDataFile.initWithPath(file.path + this._rdfDelimiter + this._rdfFileName + "_import"); 1143 1154 filePicker.file.copyTo(importRdfDataFile.parent,importRdfDataFile.leafName); 1144 1155
Note: See TracChangeset
for help on using the changeset viewer.