public bool property_load(string path) { path = this.tild_encode(path); string path1 = this.apply_profile(path); this.prop = new Property(); this.prop.load(path1); Fileinfo infoRaw = this.get_info_raw(path); clib.imsg("Property load {0} {1} ", (object)path1, (object)File.Exists(path1)); this.prop.set("DAV::supportedlock", "<D:lockentry><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype><D:lockscope><D:shared/></D:lockscope><D:locktype><D:write/></D:locktype></D:lockentry>"); this.load_lock(path); if (infoRaw == null) { return(false); } if (infoRaw != null) { this.prop.set("DAV::getcontentlength", clib.long_to_string(infoRaw.size)); this.prop.set("DAV::creationdate", infoRaw.created.ToString("s") + "-00:00"); this.prop.set("DAV::getlastmodified", infoRaw.modified.ToHttpDate()); this.prop.set("DAV::getcontenttype", clib.content_type(infoRaw.name)); this.prop.set("DAV::displayname", clib.xml_encode(clib.fileonly(infoRaw.name))); this.prop.set("DAV::getetag", infoRaw.etag()); if (infoRaw.isdir) { this.prop.set("DAV::resourcetype", "<D:collection/>"); } if (infoRaw.isdir) { if (this.quota_permitted > 0L) { this.prop.set("DAV::quota-available-bytes", clib.long_to_string(this.quota_permitted)); } this.prop.set("DAV::quota-used-bytes", clib.long_to_string(Quota.get(this.current_user))); } } return(true); }
private long quota_get() { return(Quota.get(this.current_user)); }