Revision 29:ec9750e9cceb src/pithos/content/localfile.js
b/src/pithos/content/localfile.js | ||
---|---|---|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
return dir_obj; |
64 |
} |
|
64 |
} |
|
65 |
|
|
66 |
function loadLocalFile(path) { |
|
67 |
var file_obj = new Object(); |
|
68 |
|
|
69 |
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); |
|
70 |
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); |
|
71 |
try { |
|
72 |
file_obj.initWithPath(path); |
|
73 |
file_obj.name = file.leafName; |
|
74 |
file_obj.owner = connection_obj.username; |
|
75 |
file_obj.creationDate = file.lastModifiedTime; |
|
76 |
file_obj.modificationDate = file.lastModifiedTime; |
|
77 |
file_obj.size = file.fileSize; |
|
78 |
file_obj.content = mimes.getByExtension(file_obj.name); |
|
79 |
file_obj.version = 0; |
|
80 |
file_obj.uri = file.path; |
|
81 |
file_obj.path = file.path; |
|
82 |
} catch(error) { |
|
83 |
alert('Could load path - ' + path); |
|
84 |
} |
|
85 |
|
|
86 |
|
|
87 |
return file_obj; |
|
88 |
} |
Also available in: Unified diff