mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.2.1
This commit is contained in:
@@ -21,8 +21,8 @@ import gplx.xowa.wikis.nss.*;
|
||||
public class Xotdb_fsys_mgr_tst {
|
||||
@Before public void init() {fxt.Clear();} private final Xow_fsys_mgr_fxt fxt = new Xow_fsys_mgr_fxt();
|
||||
@Test public void Basic() {
|
||||
fxt.Zip_(Xotdb_dir_info_.Tid_page, Bool_.N).Url_ns_fil(Xotdb_dir_info_.Tid_page, Xow_ns_.Id_main, 123, "mem/xowa/wiki/en.wikipedia.org/ns/000/page/00/00/00/01/0000000123.xdat");
|
||||
fxt.Zip_(Xotdb_dir_info_.Tid_page, Bool_.Y).Url_ns_fil(Xotdb_dir_info_.Tid_page, Xow_ns_.Id_main, 123, "mem/xowa/wiki/en.wikipedia.org/ns/000/page_zip/00/00/00/01/0000000123.zip");
|
||||
fxt.Zip_(Xotdb_dir_info_.Tid_page, Bool_.N).Url_ns_fil(Xotdb_dir_info_.Tid_page, Xow_ns_.Tid__main, 123, "mem/xowa/wiki/en.wikipedia.org/ns/000/page/00/00/00/01/0000000123.xdat");
|
||||
fxt.Zip_(Xotdb_dir_info_.Tid_page, Bool_.Y).Url_ns_fil(Xotdb_dir_info_.Tid_page, Xow_ns_.Tid__main, 123, "mem/xowa/wiki/en.wikipedia.org/ns/000/page_zip/00/00/00/01/0000000123.zip");
|
||||
}
|
||||
}
|
||||
class Xow_fsys_mgr_fxt {
|
||||
|
||||
@@ -75,7 +75,7 @@ public class Xotdb_page_itm_ {
|
||||
.Add(page.Ttl_page_db()) .Add_byte_nl();
|
||||
}
|
||||
public static void Txt_page_save(Bry_bfr bfr, int id, DateAdp modified_on, byte[] title, byte[] text, boolean add_nl) {
|
||||
int ts = Bit_.Xto_int_date_short(modified_on.XtoSegAry());
|
||||
int ts = Int_flag_bldr_.To_int_date_short(modified_on.XtoSegAry());
|
||||
bfr .Add_base85(id , Base85_.Len_int) .Add_byte(Txt_page_dlm) // needed for mass template load
|
||||
.Add_base85(ts , Base85_.Len_int) .Add_byte(Txt_page_dlm)
|
||||
.Add(title) .Add_byte(Txt_page_dlm) // needed for rebuilding ttl files
|
||||
|
||||
@@ -47,7 +47,7 @@ public class Xotdb_page_raw_parser {
|
||||
page.Id_(id);
|
||||
read = rdr.Read_next(); if (!read) throw Err_.new_wo_type("could not read timestamp");
|
||||
int timestamp = Base85_.To_int_by_bry(rdr.Bfr(), rdr.Key_pos_bgn(), rdr.Key_pos_end() - 1);
|
||||
page.Modified_on_(Bit_.Xto_date_short(timestamp));
|
||||
page.Modified_on_(Int_flag_bldr_.To_date_short(timestamp));
|
||||
read = rdr.Read_next(); if (!read) throw Err_.new_wo_type("could not read ttl");
|
||||
byte[] ttl = Bry_.Mid(rdr.Bfr(), rdr.Key_pos_bgn(), rdr.Key_pos_end() - 1);
|
||||
page.Ttl_(ttl, ns_mgr);
|
||||
|
||||
@@ -75,7 +75,7 @@ class Xowd_hive_mgr_fxt {
|
||||
return this;
|
||||
}
|
||||
public Xowd_hive_mgr_fxt Tst_fil(int fil, String expd) {
|
||||
Io_url url = wiki.Tdb_fsys_mgr().Url_ns_fil(Xotdb_dir_info_.Tid_page, Xow_ns_.Id_main, fil);
|
||||
Io_url url = wiki.Tdb_fsys_mgr().Url_ns_fil(Xotdb_dir_info_.Tid_page, Xow_ns_.Tid__main, fil);
|
||||
Tfds.Eq_str_lines(expd, Io_mgr.Instance.LoadFilStr(url));
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user