Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 42774 invoked from network); 8 Oct 2007 17:57:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Oct 2007 17:57:21 -0000 Received: (qmail 37987 invoked by uid 500); 8 Oct 2007 17:55:34 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 37946 invoked by uid 500); 8 Oct 2007 17:55:33 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 37936 invoked by uid 99); 8 Oct 2007 17:55:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 10:55:33 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 17:55:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1247E1A9832; Mon, 8 Oct 2007 10:55:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r582915 - in /incubator/cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/util/ common/xsd/src/main/java/org/apache/cxf/maven_plugin/ maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ Date: Mon, 08 Oct 2007 17:55:15 -0000 To: cxf-commits@incubator.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071008175517.1247E1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Mon Oct 8 10:55:14 2007 New Revision: 582915 URL: http://svn.apache.org/viewvc?rev=582915&view=rev Log: Merged revisions 580473 via svnmerge from https://svn.apache.org/repos/asf/incubator/cxf/trunk ........ r580473 | dkulp | 2007-09-28 15:57:28 -0400 (Fri, 28 Sep 2007) | 2 lines Remove stack traces when doing -Psetup.eclipse and such ........ Modified: incubator/cxf/branches/2.0.x-fixes/ (props changed) incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java incubator/cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java Propchange: incubator/cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java?rev=582915&r1=582914&r2=582915&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java (original) +++ incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java Mon Oct 8 10:55:14 2007 @@ -31,18 +31,45 @@ public static List getPackagesFromJar(File jarFile) throws IOException { List packageNames = new ArrayList(); - JarResource resource = new JarResource(); - for (String item : resource.getJarContents(jarFile)) { - if (!item.endsWith(".class")) { - continue; - } - String packageName = getPackageName(item); - if (!StringUtils.isEmpty(packageName) - && !packageNames.contains(packageName)) { - packageNames.add(packageName); + if (jarFile.isDirectory()) { + getPackageNamesFromDir(jarFile, jarFile, packageNames); + } else { + JarResource resource = new JarResource(); + for (String item : resource.getJarContents(jarFile)) { + if (!item.endsWith(".class")) { + continue; + } + String packageName = getPackageName(item); + if (!StringUtils.isEmpty(packageName) + && !packageNames.contains(packageName)) { + packageNames.add(packageName); + } } } return packageNames; + } + + private static void getPackageNamesFromDir(File base, File dir, List pkgs) { + boolean foundClass = false; + for (File file : dir.listFiles()) { + if (file.isDirectory()) { + getPackageNamesFromDir(base, file, pkgs); + } else if (!foundClass && file.getName().endsWith(".class")) { + foundClass = true; + String pkg = ""; + file = dir; + while (!file.equals(base)) { + if (!"".equals(pkg)) { + pkg = "." + pkg; + } + pkg = file.getName() + pkg; + file = file.getParentFile(); + } + if (!pkgs.contains(pkg)) { + pkgs.add(pkg); + } + } + } } private static String getPackageName(String clzName) { Modified: incubator/cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java?rev=582915&r1=582914&r2=582915&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java (original) +++ incubator/cxf/branches/2.0.x-fixes/common/xsd/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java Mon Oct 8 10:55:14 2007 @@ -19,9 +19,11 @@ package org.apache.cxf.maven_plugin; +import java.io.File; import java.io.IOException; import java.net.MalformedURLException; +import java.net.URISyntaxException; import java.net.URL; import java.util.Enumeration; import java.util.jar.JarEntry; @@ -60,20 +62,27 @@ return; } } - 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(); - } + if (url.getPath().endsWith(".class")) { + timestamp = new File(url.toURI()).lastModified(); + } else { + JarFile 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(); + } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } Modified: incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java?rev=582915&r1=582914&r2=582915&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java (original) +++ incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/CodegenUtils.java Mon Oct 8 10:55:14 2007 @@ -19,9 +19,11 @@ package org.apache.cxf.maven_plugin; +import java.io.File; import java.io.IOException; import java.net.MalformedURLException; +import java.net.URISyntaxException; import java.net.URL; import java.util.Enumeration; import java.util.jar.JarEntry; @@ -65,20 +67,26 @@ return; } } - 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(); - } + if (url.getPath().endsWith(".class")) { + timestamp = new File(url.toURI()).lastModified(); + } else { + JarFile 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(); + } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); }