Package java.util.jar

Examples of java.util.jar.JarEntry


        Set res = new HashSet();

        if (jarFile != null && jarrepositoryName != null){
            Enumeration entries = jarFile.entries();
            while (entries.hasMoreElements()){
                JarEntry jarEntry = (JarEntry)entries.nextElement();
                String jarEntryName = jarEntry.getName();
 
                if (jarEntryName.startsWith(jarrepositoryName//  get all excepted .class files
                        && !jarEntryName.equals(jarrepositoryName)
                        && !jarEntryName.endsWith(".class")
                ){ 
View Full Code Here


            }

            // Iterate through the files
            JarFile warArchive = new JarFile(warfileRef);
            for (Enumeration e = warArchive.entries(); e.hasMoreElements();) {
                JarEntry element = (JarEntry) e.nextElement();
                if (element.isDirectory()) {
                    continue;
                }
                String elemName = element.getName();

                // If archive date is newer than unzipped file, overwrite
                File outFile = new File(unzippedDir, elemName);
                if (outFile.exists() && (outFile.lastModified() > warfileRef.lastModified())) {
                    continue;
View Full Code Here

     */
    private Long searchJarPath(String classResourceName, File path)
            throws IOException, InterruptedException {
        JarFile jar = new JarFile(path);
        for (Enumeration e = jar.entries(); e.hasMoreElements() && !interrupted;) {
            JarEntry entry = (JarEntry) e.nextElement();
            if (entry.getName().equals(classResourceName))
                return new Long(path.lastModified());
        }
        return null;
    }
View Full Code Here

            JarFile jar;
            try {
                jar = new JarFile(url.getPath());
                Enumeration entries = jar.entries();
                while (entries.hasMoreElements()) {
                    JarEntry entry = (JarEntry)entries.nextElement();
                    if (!entry.isDirectory()
                        && !entry.getName().startsWith("META")
                        && entry.getTime() > timestamp) {
                       
                        timestamp = entry.getTime();
                    }                   
                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
View Full Code Here

        URLConnection connection = url.openConnection();
        if (connection != null) {
      // disable caches to get the correct data
      connection.setUseCaches(false);
      if (connection instanceof JarURLConnection) {
          JarEntry ent = ((JarURLConnection)connection).getJarEntry();
          if (ent != null) {
        lastModified = ent.getTime();
        if (lastModified == -1) {
            lastModified = 0;
        }
          }
      } else {
View Full Code Here

     * IOException to be thrown.
     *
     * @see #getJarEntry
     */
    public Attributes getAttributes() throws IOException {
  JarEntry e = getJarEntry();
  return e != null ? e.getAttributes() : null;
    }
View Full Code Here

     * @see #getJarEntry
     */
    public java.security.cert.Certificate[] getCertificates()
   throws IOException
    {
  JarEntry e = getJarEntry();
  return e != null ? e.getCertificates() : null;
    }
View Full Code Here

        PluginJAR jar = getPluginThatContains("native/" + lib);
        if (jar == null)
            return null;

        try {
            JarEntry entry = jar.getJarEntry("native/" + lib);

            int index = lib.lastIndexOf('.');
            String suffix = lib.substring(index, lib.length());
            lib = lib.substring(0, index);
            File temporaryDll = File.createTempFile(lib, suffix);
View Full Code Here

        PluginJAR jar = getPluginThatContains(resource);

        if (jar != null) {
            // find the entry in the Jar file
            JarEntry entry = jar.getJarEntry(resource);

            stream = jar.getInputStream(entry);
        } else {
            com.valhalla.Logger.debug("Stream was null for " + resource);
        }
View Full Code Here

        if (jar == null)
            throw new ClassNotFoundException();

        try {
            // find the entry in the Jar file
            JarEntry entry = jar.getJarEntry(className);
            InputStream stream = jar.getInputStream(entry);

            // read it into a class
            int len = (int) entry.getSize();
            int offset = 0;
            int success = 0;
            byte[] contents = new byte[len];

            while (success < len) {
                len -= success;
                offset += success;
                success = stream.read(contents, offset, len);
                if (success == -1)
                    throw new ClassNotFoundException();
            }

            stream.read(contents, 0, (int) entry.getSize());

            // actually define the class
            result = defineClass(origName, contents, 0, contents.length);

            if (resolveIt)
View Full Code Here

TOP

Related Classes of java.util.jar.JarEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.