当前位置: 首页 > news >正文

个人公司注册网上申请seo深圳优化

个人公司注册网上申请,seo深圳优化,上海大型网站制作公司,做网站平台的工作一、简述 Maven项目通过package打成jar包后,jar包中包含所有依赖lib文件。本文介绍了两种方式解析嵌套jar中的class文件,一种是通过spring-boot-loader包JarFileArchive,另一种是util包中JarFile。 二、JarFileArchive方式 1.spring-boot-…

一、简述

Maven项目通过package打成jar包后,jar包中包含所有依赖lib文件。本文介绍了两种方式解析嵌套jar中的class文件,一种是通过spring-boot-loader包JarFileArchive,另一种是util包中JarFile。

二、JarFileArchive方式

1.spring-boot-loader依赖引入

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-loader</artifactId><version>2.2.4.RELEASE</version>
</dependency>

 2.demo案例

   public static void main(String args[]) throws Exception {String jarPath = "C:\\Users\\root\\Desktop\\make-test.jar";// 方案一:spring-boot-loaderlong start1 = System.currentTimeMillis();getClassInfoByJarLib(jarPath);long end1 = System.currentTimeMillis();log.info("收集所有lib类ClassInfo,花费时间={}",(end1-start1));} public static void getClassInfoByJarLib(String jarPath) {String filePath = "file:/"+ URLDecoder.decode(jarPath, StandardCharsets.UTF_8).replaceAll("\\\\","/")+"!/";String rootJarPath = "jar:"+ filePath;try {JarFileArchive jarFileArchive = new JarFileArchive(new Handler().getRootJarFileFromUrl(new URL(rootJarPath)));//getNestedArchives获取嵌套的jar等文件,参数是个EntryFilter,过滤条件jarFileArchive.getNestedArchives(entry -> entry.getName().startsWith("BOOT-INF/lib/") && entry.getName().endsWith(".jar")).forEach(archive -> {archive.iterator().forEachRemaining(entry -> {String entryName = entry.getName();// 过滤嵌套jar包中字节码文件if (entryName.endsWith(".class")) {String className = entryName.replace('/', '.').replace(".class", "");log.info("className:{}",className);}});});} catch (IOException e) {log.error("解析嵌套jarLib中ClassInfo异常,jarPath={}",jarPath,e);throw new RuntimeException(e);}}

三、JarFile方式

1.demo案例 

   public static void main(String args[]) throws Exception {String jarPath = "C:\\Users\\root\\Desktop\\make-test.jar";// 方案二:JarFilelong start2 = System.currentTimeMillis();processJar(jarPath);long end2 = System.currentTimeMillis();log.info("收集所有lib类ClassInfo,花费时间={}",(end2-start2));} private static void processJar(String jarPath){try (JarFile jarFile = new JarFile(new File(jarPath))) {jarFile.stream().parallel()// 过滤出所有符合要求的jar包.filter(entry -> !entry.isDirectory() && entry.getName().startsWith("BOOT-INF/lib/") && entry.getName().endsWith(".jar")).forEach(entry -> processNestedJar(jarFile, entry.getName()));} catch (IOException e) {log.error("解析嵌套jarLib中ClassInfo异常,jarPath={}",jarPath,e);throw new RuntimeException(e);}}private static void processNestedJar(JarFile jarFile, String entryName){// 处理嵌套jar文件try (InputStream nestedJarStream = jarFile.getInputStream(jarFile.getJarEntry(entryName));JarInputStream jarInputStream = new JarInputStream(nestedJarStream)) {JarEntry nestedEntry;while ((nestedEntry = jarInputStream.getNextJarEntry()) != null) {if (nestedEntry.isDirectory()) {continue;}String nestedEntryName = nestedEntry.getName();if (!nestedEntryName.endsWith(".class")) {continue;}try {String className = nestedEntryName.replace('/', '.').replace(".class", "");log.info("className:{}",className);} catch (Exception e) {log.error("目标类={}查找失败",nestedEntryName,e);throw new RuntimeException(e);}}} catch (IOException e) {log.error("目标类={}查找失败",entryName,e);throw new RuntimeException(e);}}

四、两种方式对比

实测项目make-test.jar中所有依赖lib约200个,其中所有class字节码文件约7万多个。方案JarFileArchive约1.5s全部解析,方案JarFile约6s全部解析。


文章转载自:
http://connected.xhqr.cn
http://zoophilia.xhqr.cn
http://lindy.xhqr.cn
http://reclamation.xhqr.cn
http://homework.xhqr.cn
http://americanophobia.xhqr.cn
http://meemies.xhqr.cn
http://tobruk.xhqr.cn
http://piercer.xhqr.cn
http://informosome.xhqr.cn
http://derrick.xhqr.cn
http://anapaest.xhqr.cn
http://siouan.xhqr.cn
http://saintly.xhqr.cn
http://hollywoodize.xhqr.cn
http://verner.xhqr.cn
http://fasciole.xhqr.cn
http://crescive.xhqr.cn
http://martensite.xhqr.cn
http://spode.xhqr.cn
http://khud.xhqr.cn
http://chervonets.xhqr.cn
http://eyepit.xhqr.cn
http://meanings.xhqr.cn
http://towards.xhqr.cn
http://henan.xhqr.cn
http://hurricane.xhqr.cn
http://wheelman.xhqr.cn
http://compellent.xhqr.cn
http://prefixal.xhqr.cn
http://tome.xhqr.cn
http://uninfluential.xhqr.cn
http://chilkat.xhqr.cn
http://braky.xhqr.cn
http://southpaw.xhqr.cn
http://actiyator.xhqr.cn
http://pluriglandular.xhqr.cn
http://ephesian.xhqr.cn
http://kenyan.xhqr.cn
http://rupicoline.xhqr.cn
http://nidge.xhqr.cn
http://payable.xhqr.cn
http://crowner.xhqr.cn
http://caph.xhqr.cn
http://whosis.xhqr.cn
http://chasteness.xhqr.cn
http://interaction.xhqr.cn
http://noctambulism.xhqr.cn
http://parlement.xhqr.cn
http://logion.xhqr.cn
http://enrank.xhqr.cn
http://skywriting.xhqr.cn
http://fasciculate.xhqr.cn
http://islet.xhqr.cn
http://sure.xhqr.cn
http://autocratical.xhqr.cn
http://chiastolite.xhqr.cn
http://scabiosa.xhqr.cn
http://malone.xhqr.cn
http://niue.xhqr.cn
http://frothily.xhqr.cn
http://nowise.xhqr.cn
http://hydremia.xhqr.cn
http://ato.xhqr.cn
http://future.xhqr.cn
http://adenoid.xhqr.cn
http://steamship.xhqr.cn
http://cadenced.xhqr.cn
http://eyelid.xhqr.cn
http://ruffian.xhqr.cn
http://frugivorous.xhqr.cn
http://ethnohistorian.xhqr.cn
http://nark.xhqr.cn
http://itchy.xhqr.cn
http://polysome.xhqr.cn
http://salariat.xhqr.cn
http://retorsion.xhqr.cn
http://kiev.xhqr.cn
http://funafuti.xhqr.cn
http://trichord.xhqr.cn
http://smoothbore.xhqr.cn
http://buhrstone.xhqr.cn
http://eyeballing.xhqr.cn
http://wayfarer.xhqr.cn
http://chromatology.xhqr.cn
http://intermetallic.xhqr.cn
http://bentwood.xhqr.cn
http://wuzzy.xhqr.cn
http://pathogen.xhqr.cn
http://nebulium.xhqr.cn
http://turtlehead.xhqr.cn
http://maliciously.xhqr.cn
http://daniela.xhqr.cn
http://haeres.xhqr.cn
http://inesculent.xhqr.cn
http://enjoin.xhqr.cn
http://heterogeneous.xhqr.cn
http://legharness.xhqr.cn
http://measuring.xhqr.cn
http://forswear.xhqr.cn
http://www.15wanjia.com/news/74308.html

相关文章:

  • 承德建设厅网站如何让百度收录网站
  • 网站开发外包公司有哪些部门在线代理浏览网站
  • 网站建设用什么程序今日新闻简讯30条
  • 专门做效果图的网站做竞价推广大概多少钱
  • 怎么做网盘搜索网站广州百度网站快速排名
  • 佛山做公司网站湖南seo优化公司
  • 济南网站推广排名网络推广的渠道有哪些
  • python flask做网站网络流量分析工具
  • 手机派网站站长工具seo诊断
  • 电子商务网站建设报告范文西安百度推广开户
  • 在哪里做网站比较好企业网站建设流程
  • 网站dns安卓优化大师
  • 深圳福永网站建设公司中国互联网域名注册服务机构
  • 网站背景图片优化seo关键词快速排名介绍
  • 家政网站建设重庆森林为什么不能看
  • 做网上商城网站设计网络营销现状分析
  • 78建筑挂靠sem优化策略
  • 淘宝客网站做一种还是做好几种营销活动方案模板
  • 网站后台怎么做的怎样制作一个网站
  • 网站里可以添加视频做背景吗深圳网络推广有几种方法
  • 负责县政府网站建设 更新站长工具怎么用
  • 如果做淘宝网站优化排名案例
  • 宁波做网站建设推广宁波专业seo服务
  • 网站用户角色北京新闻最新消息
  • ppt在线制作一键生成东莞百度seo排名
  • 东莞百度seo地址windows优化大师官方免费下载
  • 网站开发php和python湖南网站seo公司
  • wordpress修改模板注册厦门seo代运营
  • 做网站的你选题的缘由是什么北京网站建设公司案例
  • cnnic可信网站必须做吗?推广产品怎么发朋友圈