Code example for JarEntry

Methods: setTime

0
            jarFile.delete(); // in case some older file is hanging around, get rid of it
            stream = new FileOutputStream(jarFile);
            out = new JarOutputStream(stream);
 
            // Add archive entry for the descriptor 
            JarEntry jarAdd = new JarEntry("META-INF/rhq-plugin.xml");
            jarAdd.setTime(System.currentTimeMillis());
            out.putNextEntry(jarAdd);
 
            // Write the descriptor - note that we assume the xml file is in the test classloader 
            URL descriptorURL = getDescriptorURL(descriptorXmlFilename);
            in = descriptorURL.openStream();
            StreamUtil.copy(in, out, false);
 
            return jarFile;
        } finally { 
            if (in != null) {
                in.close();
            } 
            if (out != null) {