1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

v2.11.4.1

This commit is contained in:
gnosygnu
2015-11-22 21:39:33 -05:00
parent 8a5d58a973
commit 097e6c7f80
581 changed files with 2897 additions and 2097 deletions

View File

@@ -18,10 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
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 final Gfo_url_encoder Md5_decoder = Gfo_url_encoder_.New__http_url().Init__same__many(Byte_ascii.Plus).Make();
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));
ttl = Md5_decoder.Decode(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
}
public static byte[] Ttl_standardize(byte[] ttl) {

View File

@@ -16,6 +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.core.stores.*;
import gplx.dbs.*;
public class Xof_lnki_page {
public static final int Null = -1;

View File

@@ -16,6 +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.core.stores.*;
import gplx.dbs.*;
public class Xof_lnki_time {
public static double Db_save_double(double v) {return v;}

View File

@@ -16,6 +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.core.envs.*;
import gplx.langs.htmls.encoders.*;
import gplx.xowa.files.repos.*; import gplx.xowa.files.fsdb.*;
public class Xof_url_bldr {
@@ -204,7 +205,7 @@ public class Xof_url_bldr {
Bry_lossy_page = Bry_.new_a7("lossy-page"), Bry_page = Bry_.new_a7("page")
, Bry_lossy_page1 = Bry_.new_a7("lossy-page1-"), Bry_page1 = Bry_.new_a7("page1-"), Bry_seek = Bry_.new_a7("seek%3D");
public static final Xof_url_bldr Temp = new Xof_url_bldr();
private static final Url_encoder encoder_src_http = Url_encoder.new_http_url_(); // NOTE: changed from new_html_href_mw_ to new_url_ on 2012-11-19; issues with A%2Cb becoming A%252Cb
private static final Gfo_url_encoder encoder_src_http = Gfo_url_encoder_.Http_url; // NOTE: changed from new_html_href_mw_ to new_url_ on 2012-11-19; issues with A%2Cb becoming A%252Cb
public static Xof_url_bldr new_v2() {
Xof_url_bldr rv = new Xof_url_bldr();
rv.time_dlm = Byte_ascii.Dash;

View File

@@ -73,7 +73,7 @@ public class Xof_xfer_itm implements Xof_file_itm {
this.lnki_exec_tid = exec_tid; this.lnki_wiki_abrv = wiki_abrv;
this.lnki_type = lnki_type; this.lnki_upright = upright; this.lnki_w = w; this.lnki_h = h; this.lnki_time = time; this.lnki_page = page;
this.file_is_orig = !Xof_xfer_itm_.Lnki_thumbable_calc(lnki_type, lnki_w, lnki_h);
this.lnki_ttl = Xof_file_wkr_.Md5_decoder.Decode_lax(Xof_file_wkr_.Ttl_standardize(ttl));
this.lnki_ttl = Xof_file_wkr_.Md5_decoder.Decode(Xof_file_wkr_.Ttl_standardize(ttl));
this.Orig_ttl_(ttl);
this.orig_ext = Xof_ext_.new_by_ttl_(ttl);
if (lnki_time != Xof_lnki_time.Null && !orig_ext.Id_is_media()) // thumbtime is set, but ext is not media; PAGE:en.w:Moon; EX:[[File:A.png|thumbtime=0:02]] DATE:2014-07-22
@@ -110,7 +110,7 @@ public class Xof_xfer_itm implements Xof_file_itm {
public void Orig_ttl_and_redirect_(byte[] ttl, byte[] redirect) {
this.orig_redirect = redirect;
this.lnki_ttl = orig_redirect == Xop_redirect_mgr.Redirect_null_bry ? Bry_.Copy(ttl) : orig_redirect;
this.lnki_ttl = Xof_file_wkr_.Md5_decoder.Decode_lax(Xof_file_wkr_.Ttl_standardize(lnki_ttl)); // NOTE: this line is repeated in static method below
this.lnki_ttl = Xof_file_wkr_.Md5_decoder.Decode(Xof_file_wkr_.Ttl_standardize(lnki_ttl)); // NOTE: this line is repeated in static method below
this.orig_ttl = lnki_ttl;
this.orig_ttl_md5 = Xof_file_wkr_.Md5_fast(lnki_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
this.orig_ext = Xof_ext_.new_by_ttl_(lnki_ttl);

View File

@@ -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.ios.*;
import gplx.core.ios.*; import gplx.core.envs.*;
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() {}

View File

@@ -16,7 +16,8 @@ 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.core.primitives.*; import gplx.dbs.*;
import gplx.core.primitives.*; import gplx.core.envs.*;
import gplx.dbs.*;
import gplx.xowa.files.fsdb.*; import gplx.xowa.wikis.*;
public class Xof_cache_mgr implements GfoInvkAble {
private final Gfo_usr_dlg usr_dlg; private final Xoae_wiki_mgr wiki_mgr; private final Xoa_repo_mgr repo_mgr;

View File

@@ -79,7 +79,7 @@ public class Xou_cache_itm {
return key_bfr.To_bry_and_clear();
}
}
class Xof_cache_mgr_sorter implements gplx.lists.ComparerAble {
class Xof_cache_mgr_sorter implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
Xou_cache_itm lhs = (Xou_cache_itm)lhsObj;
Xou_cache_itm rhs = (Xou_cache_itm)rhsObj;

View File

@@ -207,7 +207,7 @@ class Xou_cache_grp {
}
public Xou_cache_itm Get_at(int i) {return (Xou_cache_itm)list.Get_at(i);}
}
class Xou_cache_grp_sorter implements gplx.lists.ComparerAble {
class Xou_cache_grp_sorter implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
Xou_cache_grp lhs = (Xou_cache_grp)lhsObj;
Xou_cache_grp rhs = (Xou_cache_grp)rhsObj;

View File

@@ -16,11 +16,12 @@ 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.cnvs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.primitives.*; import gplx.xowa.bldrs.wms.*;
import gplx.core.primitives.*; import gplx.core.envs.*;
import gplx.xowa.bldrs.wms.*;
public class Xof_img_wkr_resize_img_imageMagick implements Xof_img_wkr_resize_img {
private final Xowmf_mgr wmf_mgr; private final ProcessAdp cmd_convert, cmd_convert_svg_to_png;
private final Xowmf_mgr wmf_mgr; private final Process_adp cmd_convert, cmd_convert_svg_to_png;
private boolean init_needed = true;
public Xof_img_wkr_resize_img_imageMagick(Xowmf_mgr wmf_mgr, ProcessAdp cmd_convert, ProcessAdp cmd_convert_svg_to_png) {
public Xof_img_wkr_resize_img_imageMagick(Xowmf_mgr wmf_mgr, Process_adp cmd_convert, Process_adp cmd_convert_svg_to_png) {
this.wmf_mgr = wmf_mgr; this.cmd_convert = cmd_convert; this.cmd_convert_svg_to_png = cmd_convert_svg_to_png;
}
public boolean Resize_exec(Io_url src, Io_url trg, int trg_w, int trg_h, int ext_id, String_obj_ref rslt_val) {
@@ -32,7 +33,7 @@ public class Xof_img_wkr_resize_img_imageMagick implements Xof_img_wkr_resize_im
cmd_convert.Prog_dlg_(usr_dlg);
cmd_convert_svg_to_png.Prog_dlg_(usr_dlg);
}
ProcessAdp cmd = ext_id == Xof_ext_.Id_svg ? cmd_convert_svg_to_png : cmd_convert;
Process_adp cmd = ext_id == Xof_ext_.Id_svg ? cmd_convert_svg_to_png : cmd_convert;
cmd.Prog_fmt_(String_.Replace(wmf_mgr.Download_wkr().Download_xrg().Prog_fmt_hdr(), "~", "~~") + " converting: ~{process_seconds} second(s); ~{process_exe_name} ~{process_exe_args}");
cmd.Run(src.Raw(), trg.Raw(), trg_w, trg_h);
rslt_val.Val_(cmd.Rslt_out());

View File

@@ -16,6 +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; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.stores.*;
import gplx.dbs.*;
class Fsdb_regy_fil_tbl {
public Fsdb_regy_fil_itm Select(String name, boolean is_orig, int w, int thumbtime) {

View File

@@ -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.core.ios.*; import gplx.core.brys.fmtrs.*;
import gplx.core.ios.*; import gplx.core.brys.fmtrs.*; import gplx.core.envs.*;
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

View File

@@ -16,6 +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.tsts; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
import gplx.core.envs.*;
import gplx.fsdb.*; import gplx.fsdb.meta.*; import gplx.dbs.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.xowa.files.cnvs.*; import gplx.xowa.files.exts.*; import gplx.xowa.files.gui.*;
import gplx.fsdb.data.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.files.repos.*; import gplx.xowa.wikis.data.*;

View File

@@ -16,12 +16,13 @@ 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.imgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.envs.*;
public class Xof_img_wkr_convert_djvu_to_tiff_ {
public static Xof_img_wkr_convert_djvu_to_tiff new_app(ProcessAdp process) {return new Xof_img_wkr_convert_djvu_to_tiff_app(process);}
public static Xof_img_wkr_convert_djvu_to_tiff new_app(Process_adp process) {return new Xof_img_wkr_convert_djvu_to_tiff_app(process);}
public static Xof_img_wkr_convert_djvu_to_tiff new_mok(int w, int h) {return new Xof_img_wkr_convert_djvu_to_tiff_mok(w, h);}
}
class Xof_img_wkr_convert_djvu_to_tiff_app implements Xof_img_wkr_convert_djvu_to_tiff {
public Xof_img_wkr_convert_djvu_to_tiff_app(ProcessAdp process) {this.process = process;} ProcessAdp process;
public Xof_img_wkr_convert_djvu_to_tiff_app(Process_adp process) {this.process = process;} Process_adp process;
public boolean Exec(Io_url src, Io_url trg) {
process.Run(src, trg);
return process.Exit_code_pass();

View File

@@ -16,14 +16,15 @@ 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.imgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.envs.*;
import gplx.gfui.*;
import gplx.xowa.bldrs.wms.*;
public interface Xof_img_wkr_query_img_size {
SizeAdp Exec(Io_url url);
}
class Xof_img_wkr_query_img_size_imageMagick implements Xof_img_wkr_query_img_size {
private final Xowmf_mgr wmf_mgr; private final ProcessAdp cmd;
public Xof_img_wkr_query_img_size_imageMagick(Xowmf_mgr wmf_mgr, ProcessAdp cmd) {this.wmf_mgr = wmf_mgr; this.cmd = cmd;}
private final Xowmf_mgr wmf_mgr; private final Process_adp cmd;
public Xof_img_wkr_query_img_size_imageMagick(Xowmf_mgr wmf_mgr, Process_adp cmd) {this.wmf_mgr = wmf_mgr; this.cmd = cmd;}
public SizeAdp Exec(Io_url url) {
cmd.Prog_fmt_(String_.Replace(wmf_mgr.Download_wkr().Download_xrg().Prog_fmt_hdr(), "~", "~~") + " querying: ~{process_seconds} second(s); ~{process_exe_name} ~{process_exe_args}");
cmd.Run(url);

View File

@@ -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.repos; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.btries.*;
import gplx.core.btries.*; import gplx.core.envs.*;
public class Xof_repo_itm_ {
public static final int Dir_depth_null = -1, Dir_depth_wmf = 2, Dir_depth_xowa = 4;
public static final byte Mode_orig = 0, Mode_thumb = 1, Mode_nil = Byte_.Max_value_127;

View File

@@ -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.core.primitives.*;
import gplx.core.primitives.*; import gplx.core.envs.*;
import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*; import gplx.xowa.files.bins.*; import gplx.xowa.files.origs.*;
import gplx.xowa.files.gui.*;
import gplx.xowa.wikis.tdbs.metas.*;