mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.8.5.1'
This commit is contained in:
@@ -20,27 +20,29 @@ import gplx.core.btries.*; import gplx.core.consoles.*;
|
||||
import gplx.xowa.apps.fsys.*; import gplx.xowa.files.exts.*;
|
||||
import gplx.xowa.wikis.domains.*;
|
||||
public class Xof_repo_itm implements Gfo_invk {
|
||||
private final Xoa_fsys_mgr app_fsys; private final Xof_rule_mgr ext_rule_mgr; private final Bry_bfr tmp_bfr = Bry_bfr_.Reset(300);
|
||||
private final Xoa_fsys_mgr app_fsys; private final Xof_rule_mgr ext_rule_mgr;
|
||||
public Xof_repo_itm(byte[] key, Xoa_fsys_mgr app_fsys, Xof_rule_mgr ext_rule_mgr, byte[] wiki_domain) {
|
||||
this.key = key; this.app_fsys = app_fsys; this.ext_rule_mgr = ext_rule_mgr;
|
||||
Wiki_domain_(wiki_domain);
|
||||
}
|
||||
public byte[] Key() {return key;} private final byte[] key;
|
||||
public byte[] Wiki_domain() {return wiki_domain;} private byte[] wiki_domain;
|
||||
public byte[] Wiki_abrv_xo() {return wiki_abrv_xo;} private byte[] wiki_abrv_xo;
|
||||
public byte[] Root_bry() {return root_bry;} private byte[] root_bry;
|
||||
public byte[] Root_http() {return root_http;} private byte[] root_http = Bry_.Empty;
|
||||
public byte Dir_spr() {return dir_spr;} private byte dir_spr;
|
||||
public boolean Fsys_is_wnt() {return fsys_is_wnt;} public Xof_repo_itm Fsys_is_wnt_(boolean v) {fsys_is_wnt = v; return this;} private boolean fsys_is_wnt;
|
||||
public boolean Wmf_fsys() {return wmf_fsys;} public Xof_repo_itm Wmf_fsys_(boolean v) {wmf_fsys = v; return this;} private boolean wmf_fsys;
|
||||
public boolean Wmf_api() {return wmf_api;} public Xof_repo_itm Wmf_api_(boolean v) {wmf_api = v; return this;} private boolean wmf_api;
|
||||
public boolean Tarball() {return tarball;} public Xof_repo_itm Tarball_(boolean v) {tarball = v; return this;} private boolean tarball;
|
||||
public byte[][] Mode_names() {return mode_names;} private byte[][] mode_names = new byte[][] {Xof_repo_itm_.Mode_names_key[0], Xof_repo_itm_.Mode_names_key[1]};
|
||||
public int Dir_depth() {return dir_depth;} public Xof_repo_itm Dir_depth_(int v) {dir_depth = v; return this;} private int dir_depth = 4;
|
||||
public Xof_rule_grp Ext_rules() {return ext_rules;} private Xof_rule_grp ext_rules;
|
||||
public Xof_repo_itm Ext_rules_(byte[] ext_rules_key) {ext_rules = ext_rule_mgr.Get_or_new(ext_rules_key); return this;}
|
||||
public boolean Primary() {return primary;} public Xof_repo_itm Primary_(boolean v) {primary = v; return this;} private boolean primary;
|
||||
public void Wiki_domain_(byte[] v) {
|
||||
public byte[] Key() {return key;} private final byte[] key;
|
||||
public byte[] Wiki_domain() {return wiki_domain;} private byte[] wiki_domain;
|
||||
public byte[] Wiki_abrv_xo() {return wiki_abrv_xo;} private byte[] wiki_abrv_xo;
|
||||
public byte[] Root_bry() {return root_bry;} private byte[] root_bry;
|
||||
public byte[] Root_http() {return root_http;} private byte[] root_http = Bry_.Empty;
|
||||
public String Root_str() {return root_str;} private String root_str;
|
||||
public byte Dir_spr() {return dir_spr;} private byte dir_spr;
|
||||
public boolean Fsys_is_wnt() {return fsys_is_wnt;} public Xof_repo_itm Fsys_is_wnt_(boolean v) {fsys_is_wnt = v; return this;} private boolean fsys_is_wnt;
|
||||
public boolean Shorten_ttl() {return shorten_ttl;} public Xof_repo_itm Shorten_ttl_(boolean v) {shorten_ttl = v; return this;} private boolean shorten_ttl = true;
|
||||
public boolean Wmf_fsys() {return wmf_fsys;} public Xof_repo_itm Wmf_fsys_(boolean v) {wmf_fsys = v; return this;} private boolean wmf_fsys;
|
||||
public boolean Wmf_api() {return wmf_api;} public Xof_repo_itm Wmf_api_(boolean v) {wmf_api = v; return this;} private boolean wmf_api;
|
||||
public boolean Tarball() {return tarball;} public Xof_repo_itm Tarball_(boolean v) {tarball = v; return this;} private boolean tarball;
|
||||
public byte[][] Mode_names() {return mode_names;} private byte[][] mode_names = new byte[][] {Xof_repo_itm_.Mode_names_key[0], Xof_repo_itm_.Mode_names_key[1]};
|
||||
public int Dir_depth() {return dir_depth;} public Xof_repo_itm Dir_depth_(int v) {dir_depth = v; return this;} private int dir_depth = 4;
|
||||
public Xof_rule_grp Ext_rules() {return ext_rules;} private Xof_rule_grp ext_rules;
|
||||
public Xof_repo_itm Ext_rules_(byte[] ext_rules_key) {ext_rules = ext_rule_mgr.Get_or_new(ext_rules_key); return this;}
|
||||
public boolean Primary() {return primary;} public Xof_repo_itm Primary_(boolean v) {primary = v; return this;} private boolean primary;
|
||||
public void Wiki_domain_(byte[] v) {
|
||||
this.wiki_domain = v;
|
||||
Xow_domain_itm domain_itm = Xow_domain_itm_.parse(v);
|
||||
if (domain_itm == null) {
|
||||
@@ -63,15 +65,16 @@ public class Xof_repo_itm implements Gfo_invk {
|
||||
this.dir_spr = root_url.Info().DirSpr_byte();
|
||||
this.root_http = root_url.To_http_file_bry();
|
||||
}
|
||||
this.root_str = root_str;
|
||||
return this;
|
||||
}
|
||||
public byte[] Gen_name_src(byte[] name) {
|
||||
public byte[] Gen_name_src(Bry_bfr tmp_bfr, byte[] name) {
|
||||
if (!fsys_is_wnt || wmf_fsys) return name;
|
||||
return Xof_repo_itm_.Ttl_invalid_fsys_chars(tmp_bfr, name);
|
||||
}
|
||||
public byte[] Gen_name_trg(byte[] bry, byte[] md5, Xof_ext ext) {
|
||||
byte[] rv = Gen_name_src(bry);
|
||||
return Xof_repo_itm_.Ttl_shorten_ttl(tmp_bfr, rv, ttl_max_len, md5, ext.Ext());
|
||||
public byte[] Gen_name_trg(Bry_bfr tmp_bfr, byte[] bry, byte[] md5, Xof_ext ext) {
|
||||
byte[] rv = Gen_name_src(tmp_bfr, bry);
|
||||
return shorten_ttl ? Xof_repo_itm_.Ttl_shorten_ttl(tmp_bfr, rv, Ttl__max_len, md5, ext.Ext()) : rv;
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_owner)) throw Err_.new_unimplemented_w_msg("deprecated repo_itm.owner");
|
||||
@@ -84,5 +87,5 @@ public class Xof_repo_itm implements Gfo_invk {
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_owner = "owner", Invk_fsys_ = "fsys_", Invk_ext_rules_ = "ext_rules_", Invk_primary_ = "primary_", Invk_wmf_api_ = "wmf_api_", Invk_tarball_ = "tarball_";
|
||||
private static final int ttl_max_len = 180;
|
||||
public static final int Ttl__max_len = 180;
|
||||
}
|
||||
|
||||
@@ -21,5 +21,5 @@ public interface Xow_repo_mgr {
|
||||
Xof_repo_pair Repos_get_by_wiki(byte[] wiki);
|
||||
Xof_repo_pair[] Repos_ary();
|
||||
Xof_repo_itm Get_trg_by_id_or_null(int id, byte[] lnki_ttl, byte[] page_url);
|
||||
Xof_repo_itm Get_src_by_id_or_null(int id, byte[] lnki_ttl, byte[] page_url);
|
||||
Xof_repo_itm Get_src_by_id_or_null(int id, byte[] lnki_ttl, byte[] page_url);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@ public class Xowe_repo_mgr implements Xow_repo_mgr, Gfo_invk {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void Repos_clear() {repos.Clear();}
|
||||
public void Clone(Xowe_repo_mgr src) {
|
||||
this.Repos_clear();
|
||||
int len = src.Repos_len();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Xof_repo_pair repo_pair = src.Repos_get_at(i);
|
||||
@@ -75,6 +77,9 @@ public class Xowe_repo_mgr implements Xow_repo_mgr, Gfo_invk {
|
||||
else
|
||||
return pair.Src();
|
||||
}
|
||||
public Xof_repo_itm Get_trg_by_tid_or_null(byte[] tid) {
|
||||
return null;
|
||||
}
|
||||
public Xof_repo_pair[] Repos_ary() {if (repos_ary == null) repos_ary = (Xof_repo_pair[])repos.To_ary(Xof_repo_pair.class); return repos_ary;} private Xof_repo_pair[] repos_ary;
|
||||
public boolean Xfer_by_meta(Xof_xfer_itm xfer_itm, Xof_xfer_queue queue) {
|
||||
byte[] ttl = xfer_itm.Lnki_ttl();
|
||||
|
||||
Reference in New Issue
Block a user