mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.1.1
This commit is contained in:
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files; import gplx.*; import gplx.xowa.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.fsdb.data.*; import gplx.fsdb.meta.*; import gplx.xowa.files.fsdb.*;
|
||||
public class Xof_bin_updater {
|
||||
private final Fsd_img_itm tmp_img_itm = new Fsd_img_itm(); private final Fsd_thm_itm tmp_thm_itm = Fsd_thm_itm.new_(); private final Fsd_fil_itm tmp_fil_itm = new Fsd_fil_itm();
|
||||
|
||||
@@ -82,7 +82,7 @@ public class Xof_ext_ {
|
||||
public static Xof_ext new_by_ttl_(byte[] ttl) {
|
||||
int ttl_len = ttl.length;
|
||||
int dot_pos = Bry_find_.Find_bwd(ttl, Byte_ascii.Dot);
|
||||
byte[] ext = (dot_pos == Bry_.NotFound || dot_pos == ttl_len) ? Bry_.Empty : Bry_.Lcase__all(ttl, dot_pos + 1, ttl_len); // +1 to bgn after .
|
||||
byte[] ext = (dot_pos == Bry_find_.Not_found || dot_pos == ttl_len) ? Bry_.Empty : Bry_.Lcase__all(ttl, dot_pos + 1, ttl_len); // +1 to bgn after .
|
||||
return new_(Get_id_by_ext_(ext), ext);
|
||||
}
|
||||
public static Xof_ext new_by_ext_(byte[] ext) {return new_(Get_id_by_ext_(ext), ext);}
|
||||
@@ -98,7 +98,7 @@ public class Xof_ext_ {
|
||||
public static byte[] Lower_ext(byte[] ttl) {
|
||||
int dot_pos = Bry_find_.Find_bwd(ttl, Byte_ascii.Dot);
|
||||
int ttl_len = ttl.length;
|
||||
if (dot_pos == Bry_.NotFound || dot_pos == ttl_len - 1) return ttl;
|
||||
if (dot_pos == Bry_find_.Not_found || dot_pos == ttl_len - 1) return ttl;
|
||||
Object o = ext_hash.Get_by_mid(ttl, dot_pos + 1, ttl_len);
|
||||
if (o == null) return ttl;
|
||||
byte[] ext = (byte[])o;
|
||||
|
||||
@@ -16,10 +16,10 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files; import gplx.*; import gplx.xowa.*;
|
||||
import gplx.core.threads.*; import gplx.ios.*;
|
||||
import gplx.core.threads.*; import gplx.core.ios.*;
|
||||
import gplx.fsdb.*; import gplx.fsdb.meta.*; import gplx.fsdb.data.*; import gplx.xowa.files.fsdb.*;
|
||||
import gplx.xowa.files.repos.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.xowa.files.caches.*; import gplx.xowa.files.gui.*;
|
||||
import gplx.xowa.htmls.hdumps.core.*;
|
||||
import gplx.xowa.htmls.core.makes.imgs.*;
|
||||
public class Xof_file_wkr implements Gfo_thread_wkr {
|
||||
private final Xof_orig_mgr orig_mgr; private final Xof_bin_mgr bin_mgr; private final Fsm_mnt_mgr mnt_mgr; private final Xou_cache_mgr cache_mgr;
|
||||
private final Gfo_usr_dlg usr_dlg; private final Xow_repo_mgr repo_mgr; private final Xog_js_wkr js_wkr;
|
||||
@@ -35,10 +35,10 @@ public class Xof_file_wkr implements Gfo_thread_wkr {
|
||||
public void Exec() {
|
||||
int len = imgs.Count();
|
||||
for (int i = 0; i < len; ++i)
|
||||
Ctor_by_hdump(hpg, (Xohd_data_itm__base)imgs.Get_at(i));
|
||||
Ctor_by_hdump(hpg, (Xohd_img_itm__base)imgs.Get_at(i));
|
||||
Xoa_app_.Usr_dlg().Prog_none("", "", "");
|
||||
}
|
||||
private void Ctor_by_hdump(Xoa_page hpg, Xohd_data_itm__base hdump) {
|
||||
private void Ctor_by_hdump(Xoa_page hpg, Xohd_img_itm__base hdump) {
|
||||
Xof_fsdb_itm fsdb = new Xof_fsdb_itm();
|
||||
fsdb.Init_at_lnki(Xof_exec_tid.Tid_wiki_page, hpg.Wiki().Domain_itm().Abrv_xo(), hdump.Lnki_ttl(), hdump.Lnki_type(), hdump.Lnki_upright(), hdump.Lnki_w(), hdump.Lnki_h(), hdump.Lnki_time(), hdump.Lnki_page(), Xof_patch_upright_tid_.Tid_all);
|
||||
fsdb.Init_at_hdoc(hdump.Html_uid(), hdump.Html_elem_tid());
|
||||
@@ -118,7 +118,7 @@ public class Xof_file_wkr implements Gfo_thread_wkr {
|
||||
}
|
||||
public static void Save_bin(Xof_fsdb_itm itm, Fsm_mnt_mgr mnt_mgr, Io_url html_url) {
|
||||
long rdr_len = Io_mgr.Instance.QueryFil(html_url).Size();
|
||||
Io_stream_rdr rdr = gplx.ios.Io_stream_rdr_.file_(html_url);
|
||||
Io_stream_rdr rdr = gplx.core.ios.Io_stream_rdr_.file_(html_url);
|
||||
try {
|
||||
rdr.Open();
|
||||
Fsm_mnt_itm mnt_itm = mnt_mgr.Mnts__get_insert();
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.files; import gplx.*; import gplx.xowa.*;
|
||||
import gplx.core.consoles.*; import gplx.langs.htmls.encoders.*;
|
||||
public class Xof_file_wkr_ {
|
||||
public static final Url_encoder Md5_decoder = Url_encoder.new_http_url_().Itms_raw_same_many(Byte_ascii.Plus);
|
||||
public static byte[] Md5_fast(byte[] v) {return Bry_.new_a7(gplx.security.HashAlgo_.Md5.CalcHash(Console_adp_.Noop, gplx.ios.IoStream_.ary_(v)));}
|
||||
public static byte[] Md5_fast(byte[] v) {return Bry_.new_a7(gplx.core.security.HashAlgo_.Md5.CalcHash(Console_adp_.Noop, gplx.core.ios.IoStream_.ary_(v)));}
|
||||
public static byte[] Md5(byte[] ttl) {
|
||||
ttl = Md5_decoder.Decode_lax(Ttl_standardize(ttl));
|
||||
return Xof_file_wkr_.Md5_fast(ttl); // NOTE: md5 is calculated off of url_decoded ttl; EX: A%2Cb is converted to A,b and then md5'd. note that A%2Cb still remains the title
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files; import gplx.*; import gplx.xowa.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.xowa.files.gui.*; import gplx.xowa.files.repos.*;
|
||||
import gplx.xowa.parsers.lnkis.*;
|
||||
public class Xof_fsdb_itm implements Xof_file_itm {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class Xof_img_size {
|
||||
&& !Xop_lnki_type.Id_is_thumbable(lnki_type) // not thumb which is implicitly 220; PAGE:en.w:Edward_Snowden; DATE:2015-08-17
|
||||
)
|
||||
lnki_w = orig_w; // use original size; EX:[[File:A.ogv]] -> [[File:A.ogv|550px]] where 550px is orig_w; DATE:2015-08-07
|
||||
if (Bitmask_.Has_int(lnki_type, Xop_lnki_type.Id_frame) // frame: always return orig size; Linker.php!makeThumbLink2; // Use image dimensions, don't scale
|
||||
if (Bitmask_.Has_int(lnki_type, Xop_lnki_type.Id_frame) // frame: always return orig size; Linker.php!makeThumbLink2; // Use image dimensions, don't scale
|
||||
&& lnki_h == Null) { // unless lnki_h specified; DATE:2013-12-22
|
||||
html_w = file_w = orig_w;
|
||||
html_h = file_h = orig_h;
|
||||
|
||||
@@ -111,7 +111,7 @@ public class Xof_url_bldr {
|
||||
bfr.Add_byte(dir_spr); // add dir_spr; EX: "\"
|
||||
bfr.Add_int_variable(file_w).Add(Bry_px); // add file_w; EX: "220px"
|
||||
if (Xof_lnki_time.Null_n(time))
|
||||
bfr.Add_byte(time_dlm).Add_str(Xof_lnki_time.X_str(time)); // add time EX: "@5"
|
||||
bfr.Add_byte(time_dlm).Add_str_a7(Xof_lnki_time.X_str(time)); // add time EX: "@5"
|
||||
else if (page != Xof_lnki_page.Null)
|
||||
bfr.Add_byte(Byte_ascii.Dash).Add_int_variable(page); // add page EX: "-5"
|
||||
bfr.Add_byte(Byte_ascii.Dot); // add . EX: "."
|
||||
@@ -131,7 +131,7 @@ public class Xof_url_bldr {
|
||||
bfr.Add_int_variable(file_w); // add file_w; EX: "220"; PAGE:en.w:Alice_Brady; DATE:2015-08-06
|
||||
bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
if (Xof_lnki_time.Null_n(time))
|
||||
bfr.Add(Bry_seek).Add_str(Xof_lnki_time.X_str(time)).Add_byte(Byte_ascii.Dash);// add seek; EX: "seek%3D5-"
|
||||
bfr.Add(Bry_seek).Add_str_a7(Xof_lnki_time.X_str(time)).Add_byte(Byte_ascii.Dash);// add seek; EX: "seek%3D5-"
|
||||
else
|
||||
bfr.Add_byte(Byte_ascii.Dash); // add mid; EX: "-"; NOTE: was "mid-"; DATE:2015-08-06
|
||||
break;
|
||||
|
||||
@@ -37,7 +37,7 @@ class Bin_fetcher_fsys implements Bin_fetcher {
|
||||
}
|
||||
}
|
||||
class Bin_fetcher_http implements Bin_fetcher {
|
||||
private gplx.ios.IoEngine_xrg_downloadFil download = gplx.ios.IoEngine_xrg_downloadFil.new_("", Io_url_.Empty);
|
||||
private gplx.core.ios.IoEngine_xrg_downloadFil download = gplx.core.ios.IoEngine_xrg_downloadFil.new_("", Io_url_.Empty);
|
||||
public void Init_src_str(String src) {this.src = src;} private String src;
|
||||
public boolean Save_as_url(Io_url trg) {
|
||||
return download.Src_(src).Trg_(trg).Exec();
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public interface Io_download_mgr {
|
||||
Io_stream_rdr Download_as_rdr(String src);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Io_download_mgr_ {
|
||||
public static Io_download_mgr new_system() {return new Io_download_mgr__system();}
|
||||
public static Io_download_mgr__memory new_memory() {return new Io_download_mgr__memory();}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Io_download_mgr__memory implements Io_download_mgr {
|
||||
private final Ordered_hash hash = Ordered_hash_.New();
|
||||
public void Clear() {hash.Clear();}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.core.primitives.*; import gplx.ios.*;
|
||||
import gplx.core.primitives.*; import gplx.core.ios.*;
|
||||
import gplx.fsdb.meta.*;
|
||||
import gplx.xowa.files.repos.*; import gplx.xowa.files.fsdb.*; import gplx.xowa.files.cnvs.*; import gplx.xowa.files.caches.*;
|
||||
import gplx.xowa.bldrs.wms.*;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.fsdb.meta.*; import gplx.xowa.files.fsdb.*;
|
||||
public class Xof_bin_skip_mgr {
|
||||
private Xof_bin_skip_wkr[] wkrs = new Xof_bin_skip_wkr[0]; private int wkrs_len;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.xowa.files.fsdb.*;
|
||||
public interface Xof_bin_wkr {
|
||||
byte Tid();
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.dbs.*; import gplx.ios.*; import gplx.core.caches.*; import gplx.xowa.files.fsdb.*;
|
||||
import gplx.dbs.*; import gplx.core.ios.*; import gplx.core.caches.*; import gplx.xowa.files.fsdb.*;
|
||||
import gplx.fsdb.*; import gplx.fsdb.data.*; import gplx.fsdb.meta.*;
|
||||
public class Xof_bin_wkr__fsdb_sql implements Xof_bin_wkr {
|
||||
private final Xof_bin_wkr_ids tmp_ids = new Xof_bin_wkr_ids();
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.xowa.files.fsdb.*; import gplx.xowa.files.repos.*;
|
||||
public abstract class Xof_bin_wkr__fsys_base implements Xof_bin_wkr, GfoInvkAble {
|
||||
public Xof_bin_wkr__fsys_base() {}
|
||||
@@ -25,7 +25,7 @@ public abstract class Xof_bin_wkr__fsys_base implements Xof_bin_wkr, GfoInvkAble
|
||||
public boolean Resize_allowed() {return resize_allowed;} public void Resize_allowed_(boolean v) {resize_allowed = v;} private boolean resize_allowed = false;
|
||||
public Io_stream_rdr Get_as_rdr(Xof_fsdb_itm itm, boolean is_thumb, int w) {
|
||||
Io_url src_url = this.Get_src_url(Xof_repo_itm_.Mode_by_bool(is_thumb), String_.new_u8(itm.Orig_repo_name()), itm.Orig_ttl(), itm.Orig_ttl_md5(), itm.Orig_ext(), w, itm.Lnki_time(), itm.Lnki_page());
|
||||
return (src_url == Io_url_.Empty) ? gplx.ios.Io_stream_rdr_.Noop : gplx.ios.Io_stream_rdr_.file_(src_url);
|
||||
return (src_url == Io_url_.Empty) ? gplx.core.ios.Io_stream_rdr_.Noop : gplx.core.ios.Io_stream_rdr_.file_(src_url);
|
||||
}
|
||||
public boolean Get_to_fsys(Xof_fsdb_itm itm, boolean is_thumb, int w, Io_url bin_url) {
|
||||
return Get_to_fsys(itm.Orig_repo_name(), itm.Orig_ttl(), itm.Orig_ttl_md5(), itm.Orig_ext(), is_thumb, w, itm.Lnki_time(), itm.Lnki_page(), bin_url);
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*; import gplx.core.threads.*;
|
||||
import gplx.core.ios.*; import gplx.core.threads.*;
|
||||
import gplx.xowa.apps.*;
|
||||
import gplx.xowa.files.fsdb.*; import gplx.xowa.files.repos.*;
|
||||
import gplx.xowa.wikis.domains.*;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import org.junit.*; import gplx.ios.*; import gplx.xowa.files.repos.*;
|
||||
import org.junit.*; import gplx.core.ios.*; import gplx.xowa.files.repos.*;
|
||||
public class Xof_bin_wkr__http_wmf__tst {
|
||||
private final Xof_bin_wkr__http_wmf__fxt fxt = new Xof_bin_wkr__http_wmf__fxt();
|
||||
@Before public void init() {fxt.Clear();}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Xou_cache_mgr {
|
||||
}
|
||||
return KeyVal_.Ary
|
||||
( KeyVal_.new_("cache folder", cache_dir.Xto_api())
|
||||
, KeyVal_.new_("space used", gplx.ios.Io_size_.To_str(fsys_size))
|
||||
, KeyVal_.new_("space used", gplx.core.ios.Io_size_.To_str(fsys_size))
|
||||
, KeyVal_.new_("file count", len)
|
||||
, KeyVal_.new_("oldest file", view_date == Long_.Max_value ? "" : DateAdp_.unixtime_utc_seconds_(view_date).XtoStr_fmt_iso_8561())
|
||||
);
|
||||
@@ -194,7 +194,7 @@ class Xou_cache_grp {
|
||||
cache_hash.Del(itm.Lnki_key());
|
||||
itm.Db_state_(Db_cmd_mode.Tid_delete);
|
||||
cache_tbl.Db_save(itm);
|
||||
gplx.ios.IoItmFil fil = Io_mgr.Instance.QueryFil(itm.File_url());
|
||||
gplx.core.ios.IoItmFil fil = Io_mgr.Instance.QueryFil(itm.File_url());
|
||||
if (fil.Exists()) {
|
||||
Io_mgr.Instance.DeleteFil(itm.File_url());
|
||||
deleted = true;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.caches; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.xowa.files.origs.*; import gplx.xowa.files.repos.*; import gplx.xowa.files.fsdb.*; import gplx.xowa.files.bins.*; import gplx.xowa.files.gui.*;
|
||||
public class Xou_file_itm_finder {
|
||||
private final Xou_cache_mgr cache_mgr; private final Xof_img_size img_size = new Xof_img_size(); private final Xof_url_bldr url_bldr = Xof_url_bldr.new_v2();
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.downloads; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public interface Xof_download_wkr {
|
||||
byte Download(boolean src_is_web, String src, Io_url trg, String prog_fmt_hdr);
|
||||
IoEngine_xrg_downloadFil Download_xrg();
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.downloads; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Xof_download_wkr_io implements Xof_download_wkr {
|
||||
IoEngine_xrg_downloadFil xrg = Io_mgr.Instance.DownloadFil_args("", Io_url_.Empty);
|
||||
public IoEngine_xrg_downloadFil Download_xrg() {return xrg;}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.downloads; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Xof_download_wkr_test implements Xof_download_wkr {
|
||||
public IoEngine_xrg_downloadFil Download_xrg() {return IoEngine_xrg_downloadFil.new_("", Io_url_.Empty).Trg_engine_key_(IoEngine_.MemKey);}
|
||||
public byte Download(boolean src_is_web, String src_str, Io_url trg_url, String prog_fmt_hdr) {
|
||||
|
||||
@@ -24,8 +24,8 @@ public class Xof_rule_itm implements GfoInvkAble {
|
||||
public long View_max() {return view_max;} public Xof_rule_itm View_max_(long v) {view_max = v; return this;} long view_max = Max_wildcard;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_owner)) return owner;
|
||||
else if (ctx.Match(k, Invk_make_max_)) make_max = gplx.ios.Io_size_.Load_int_(m);
|
||||
else if (ctx.Match(k, Invk_view_max_)) view_max = gplx.ios.Io_size_.Load_int_(m);
|
||||
else if (ctx.Match(k, Invk_make_max_)) make_max = gplx.core.ios.Io_size_.Load_int_(m);
|
||||
else if (ctx.Match(k, Invk_view_max_)) view_max = gplx.core.ios.Io_size_.Load_int_(m);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
return this;
|
||||
} private static final String Invk_owner = "owner", Invk_make_max_ = "make_max_", Invk_view_max_ = "view_max_";
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.fsdb; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.dbs.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.fsdb.*; import gplx.fsdb.meta.*;
|
||||
import gplx.xowa.files.*; import gplx.xowa.files.repos.*; import gplx.xowa.files.imgs.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.xowa.files.caches.*; import gplx.xowa.files.gui.*;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.fsdb.fs_roots; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.fsdb.*; import gplx.fsdb.data.*; import gplx.fsdb.meta.*;
|
||||
import gplx.xowa.files.gui.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.xowa.files.caches.*;
|
||||
public class Fs_root_fsdb_mgr implements Xof_fsdb_mgr, GfoInvkAble { // read images from file-system dir
|
||||
|
||||
@@ -58,9 +58,9 @@ class Xof_file_fxt {
|
||||
Fsm_atr_fil atr_fil = mnt_itm.Atr_mgr().Db__core();
|
||||
Fsm_bin_fil bin_fil = mnt_itm.Bin_mgr().Dbs__get_nth();
|
||||
if (arg.Is_thumb())
|
||||
mnt_itm.Insert_thm(tmp_thm, atr_fil, bin_fil, arg.Wiki(), arg.Ttl(), arg.Ext(), arg.W(), arg.H(), arg.Time(), arg.Page(), arg.Bin().length, gplx.ios.Io_stream_rdr_.mem_(arg.Bin()));
|
||||
mnt_itm.Insert_thm(tmp_thm, atr_fil, bin_fil, arg.Wiki(), arg.Ttl(), arg.Ext(), arg.W(), arg.H(), arg.Time(), arg.Page(), arg.Bin().length, gplx.core.ios.Io_stream_rdr_.mem_(arg.Bin()));
|
||||
else
|
||||
mnt_itm.Insert_img(tmp_img, atr_fil, bin_fil, arg.Wiki(), arg.Ttl(), arg.Ext(), arg.W(), arg.H(), arg.Bin().length, gplx.ios.Io_stream_rdr_.mem_(arg.Bin()));
|
||||
mnt_itm.Insert_img(tmp_img, atr_fil, bin_fil, arg.Wiki(), arg.Ttl(), arg.Ext(), arg.W(), arg.H(), arg.Bin().length, gplx.core.ios.Io_stream_rdr_.mem_(arg.Bin()));
|
||||
}
|
||||
public void Exec_get(Xof_exec_arg arg) {
|
||||
byte[] ttl_bry = arg.Ttl();
|
||||
|
||||
@@ -36,7 +36,7 @@ public class Js_img_mgr {
|
||||
String html_id = To_doc_uid(uid);
|
||||
js_wkr.Html_img_update(html_id, html_view_url.To_http_file_str(), html_w, html_h);
|
||||
if (Xop_lnki_type.Id_is_thumbable(lnki_type)) { // thumb needs to set cls and width
|
||||
js_wkr.Html_atr_set(html_id, "class", gplx.xowa.htmls.lnkis.Xoh_lnki_consts.Str_img_cls_thumbimage);
|
||||
js_wkr.Html_atr_set(html_id, "class", gplx.xowa.htmls.core.wkrs.lnkis.htmls.Xoh_lnki_consts.Str_img_cls_thumbimage);
|
||||
js_wkr.Html_atr_set("xowa_file_div_" + uid, "style", "width:" + html_w + "px;");
|
||||
}
|
||||
switch (elem_tid) {
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Xof_orig_wkr__wmf_api implements Xof_orig_wkr {
|
||||
public byte Tid() {return Xof_orig_wkr_.Tid_wmf_api;}
|
||||
public void Find_by_list(Ordered_hash rv, List_adp itms) {Xof_orig_wkr_.Find_by_list(this, rv, itms);}
|
||||
public Xof_orig_itm Find_as_itm(byte[] ttl, int list_idx, int list_len) {
|
||||
if (!gplx.ios.IoEngine_system.Web_access_enabled) return Xof_orig_itm.Null; // don't check api if download disabled, else prog messages; DATE:2015-06-17
|
||||
if (!gplx.core.ios.IoEngine_system.Web_access_enabled) return Xof_orig_itm.Null; // don't check api if download disabled, else prog messages; DATE:2015-06-17
|
||||
Xoa_app_.Usr_dlg().Prog_none("", "", Prog_msg(list_idx, list_len, ttl));
|
||||
boolean found = orig_api.Api_query_size(api_rv, download_wkr, repo_mgr, ttl, Xof_img_size.Null, Xof_img_size.Null); // pass in null size to look for orig; DATE:2015-02-10
|
||||
if (!found) return Xof_orig_itm.Null; // ttl not found by api; return
|
||||
|
||||
@@ -322,7 +322,7 @@ public class Xof_xfer_mgr {
|
||||
private boolean Cmd_download(String src_str, Io_url trg_url, boolean cur_is_orig) {
|
||||
boolean exists = false;
|
||||
if (check_file_exists_before_xfer) {
|
||||
gplx.ios.IoItmFil fil_itm = Io_mgr.Instance.QueryFil(trg_url);
|
||||
gplx.core.ios.IoItmFil fil_itm = Io_mgr.Instance.QueryFil(trg_url);
|
||||
exists = fil_itm.Exists() && fil_itm.Size() > 0;
|
||||
}
|
||||
boolean pass = false;
|
||||
@@ -330,11 +330,11 @@ public class Xof_xfer_mgr {
|
||||
pass = true;
|
||||
else {
|
||||
byte download_rslt = wmf_mgr.Download_wkr().Download(src_repo_is_wmf, src_str, trg_url, wmf_mgr.Download_wkr().Download_xrg().Prog_fmt_hdr());
|
||||
if (download_rslt == gplx.ios.IoEngine_xrg_downloadFil.Rslt_fail_host_not_found) {
|
||||
if (download_rslt == gplx.core.ios.IoEngine_xrg_downloadFil.Rslt_fail_host_not_found) {
|
||||
wiki.File_mgr().Cfg_download().Enabled_(false);
|
||||
throw Err_.new_wo_type("download_failed: host not found", "src", src_str, "trg", trg_url.Raw());
|
||||
}
|
||||
pass = download_rslt == gplx.ios.IoEngine_xrg_downloadFil.Rslt_pass;
|
||||
pass = download_rslt == gplx.core.ios.IoEngine_xrg_downloadFil.Rslt_pass;
|
||||
}
|
||||
// update meta attributes; placed here b/c Cmd_download is called by 3 procs; note that thumb meta is handled by calling procs as the logic is more specific
|
||||
if (cur_is_orig) {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.xfers; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.xowa.wikis.domains.*; import gplx.xowa.files.cnvs.*; import gplx.xowa.files.repos.*;
|
||||
import gplx.xowa.bldrs.wms.apis.*; import gplx.xowa.files.exts.*; import gplx.xowa.files.imgs.*;
|
||||
public class Xof_xfer_queue_base_fxt {
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.xfers; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import org.junit.*;
|
||||
import gplx.ios.*; import gplx.gfui.*; import gplx.xowa.files.*;
|
||||
import gplx.core.ios.*; import gplx.gfui.*; import gplx.xowa.files.*;
|
||||
public class Xof_xfer_queue_html_basic_tst {
|
||||
Xof_xfer_queue_html_fxt fxt = new Xof_xfer_queue_html_fxt();
|
||||
@Before public void init() {fxt.Clear(true);}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.files.xfers; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.core.primitives.*; import gplx.dbs.*;
|
||||
import gplx.ios.*; import gplx.xowa.wikis.domains.*; import gplx.xowa.files.*;
|
||||
import gplx.core.ios.*; import gplx.xowa.wikis.domains.*; import gplx.xowa.files.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.lnkis.*;
|
||||
public class Xof_xfer_queue_html_fxt extends Xof_xfer_queue_base_fxt {
|
||||
private final Xof_xfer_queue queue = new Xof_xfer_queue();
|
||||
|
||||
Reference in New Issue
Block a user