// // Copyright 2020 FoxyUtils ehf. All rights reserved. // // This is a commercial product and requires a license to operate. // A trial license can be obtained at https://unidoc.io // // DO NOT EDIT: generated by unitwist Go source code obfuscator. // // Use of this source code is governed by the UniDoc End User License Agreement // terms that can be accessed at https://unidoc.io/eula/ package content ;import (_d "archive/zip";_fa "bytes";_f "fmt";_c "io/ioutil";_a "net/url";_b "os";_g "strings";); // ContentType implements Content interface. func (_bac *zipDirectory )ContentType ()string {return "\u0061p\u0070l\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u002f\u007a\u0069\u0070";}; // Data implements Content interface. func (_ef *webURL )Data ()[]byte {return []byte (_ef ._fb )};type webURL struct{_fb string }; // ContentType implements Content interface. func (_ge *webURL )ContentType ()string {return "\u0074\u0065\u0078\u0074\u002f\u0070\u006c\u0061\u0069\u006e";}; // NewWebURL creates new Content webURL for provided input URL path. func NewWebURL (path string )(Content ,error ){if _ ,_dc :=_a .Parse (path );_dc !=nil {return nil ,_dc ;};return &webURL {_fb :path },nil ;}; // NewZipDirectory creates new zip compressed file that recursively reads the directory at the 'dirPath' // and stores in it's in-memory buffer. func NewZipDirectory (dirPath string )(Content ,error ){_fd :=&zipDirectory {_ga :_fa .Buffer {}};_fd ._gb =_d .NewWriter (&_fd ._ga );if _bb :=_fd .zipPath (dirPath ,"");_bb !=nil {return nil ,_bb ;};if _ee :=_fd ._gb .Close ();_ee !=nil {return nil ,_ee ; };return _fd ,nil ;}; // Method gets the query method. func (_aa *htmlFile )Method ()string {return "\u0068\u0074\u006d\u006c"}; // ContentType implements Content interface. func (_ba *htmlFile )ContentType ()string {return "\u0074e\u0078\u0074\u002f\u0068\u0074\u006dl"}; // Data implements Content interface. func (_ea *zipDirectory )Data ()[]byte {return _ea ._ga .Bytes ()}; // Method gets the zip directory method. func (_efc *zipDirectory )Method ()string {return "\u0064\u0069\u0072"}; // Method gets the web url query method. func (_da *webURL )Method ()string {return "\u0077\u0065\u0062"};func (_cb *zipDirectory )zipBasePaths (_df _b .FileInfo ,_eg ,_dce string ,_fe bool ,_ffa *_g .Builder )(string ,string ){_ffa .WriteString (_eg );if !_g .HasSuffix (_eg ,"\u002f"){_ffa .WriteRune ('/'); };_ffa .WriteString (_df .Name ());if _fe {_ffa .WriteRune ('/');};_fc :=_ffa .String ();_ffa .Reset ();_ffa .WriteString (_dce );_ffa .WriteString (_df .Name ());if _fe {_ffa .WriteRune ('/');};_fcb :=_ffa .String ();_ffa .Reset ();return _fc ,_fcb ;}; // Content is an interface used for putting the content into Client Query. type Content interface{ContentType ()string ;Method ()string ;Data ()[]byte ;}; // NewHTMLFile creates new Content htmFile for provided input path. func NewHTMLFile (path string )(Content ,error ){_gfd ,_ca :=_b .Open (path );if _ca !=nil {return nil ,_ca ;};_bf :=&htmlFile {_gf :_fa .Buffer {}};if _ ,_ca =_bf ._gf .ReadFrom (_gfd );_ca !=nil {return nil ,_ca ;};return _bf ,nil ;};type zipDirectory struct{_ga _fa .Buffer ; _gb *_d .Writer ;}; // Data implements Content interface. func (_ce *htmlFile )Data ()[]byte {return _ce ._gf .Bytes ()};type htmlFile struct{_gf _fa .Buffer };func (_aaa *zipDirectory )zipPath (_af ,_gg string )error {_dg ,_dd :=_c .ReadDir (_af );if _dd !=nil {return _f .Errorf ("\u0072\u0065\u0061di\u006e\u0067\u0020\u0064\u0069\u0072\u0065\u0063\u0074o\u0072y\u003a \u0027%\u0073\u0027\u0020\u0066\u0061\u0069\u006c\u0065\u0064\u003a\u0020\u0025\u0077",_af ,_dd ); };_ggd :=&_g .Builder {};for _ ,_eae :=range _dg {_cd ,_eb :=_aaa .zipBasePaths (_eae ,_af ,_gg ,_eae .IsDir (),_ggd );if _eae .IsDir (){if _cg :=_aaa .zipPath (_cd ,_eb );_cg !=nil {return _cg ;};continue ;};_gge ,_ed :=_c .ReadFile (_cd );if _ed !=nil {return _ed ; };_dab ,_ed :=_aaa ._gb .Create (_eb );if _ed !=nil {return _ed ;};if _ ,_ed =_dab .Write (_gge );_ed !=nil {return _ed ;};};return nil ;};