package cn.net.comsys.mdd.eclipse.plugin.j2eedt.core.javaee_5_container.librarymgmt;

import java.io.IOException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;



import com.genuitec.eclipse.j2eedt.taglib.DirTaglibInfo;

public class T {
public static void main(String[] args) throws IOException {
        
    URL url = DirTaglibInfo.class.getProtectionDomain().getCodeSource().getLocation();
    String filePath = URLDecoder.decode(url.getPath(), "UTF-8");
    if(filePath.endsWith(".jar"))
    System.out.println(filePath);
    
        //java.util.jar.JarFile file = new JarFile("E:\\frame\\jdbc\\mysql.jar");
    java.util.jar.JarFile file = new JarFile(filePath);
        Enumeration<JarEntry> entrys = file.entries();
        while(entrys.hasMoreElements()){
            JarEntry jar = entrys.nextElement();
            System.out.println(jar.getName());
        }
        
        
        file.close();
        
        
        
      //filePath= filePath.substring(0, filePath.lastIndexOf("/") + 1);
        
    }

}

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-08-31
  • 2021-08-22
  • 2021-09-04
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2021-08-14
  • 2021-12-12
  • 2021-12-10
  • 2022-01-19
  • 2021-12-25
  • 2022-03-04
相关资源
相似解决方案