Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 98964 invoked from network); 6 Jan 2011 10:02:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Jan 2011 10:02:10 -0000 Received: (qmail 21947 invoked by uid 500); 6 Jan 2011 10:02:10 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 21898 invoked by uid 500); 6 Jan 2011 10:02:10 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 21891 invoked by uid 99); 6 Jan 2011 10:02:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jan 2011 10:02:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jan 2011 10:02:08 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p06A1k8h018418 for ; Thu, 6 Jan 2011 10:01:46 GMT Message-ID: <31819237.184221294308106789.JavaMail.jira@thor> Date: Thu, 6 Jan 2011 05:01:46 -0500 (EST) From: "Helmut Swaczinna (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Created: (TOBAGO-964) Bug in resource handling for JBoss 5.0.0 vfszip protocol on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Bug in resource handling for JBoss 5.0.0 vfszip protocol on Windows ------------------------------------------------------------------- Key: TOBAGO-964 URL: https://issues.apache.org/jira/browse/TOBAGO-964 Project: MyFaces Tobago Issue Type: Bug Components: Core Affects Versions: 1.0.33 Environment: Windows Reporter: Helmut Swaczinna Priority: Minor Separator chars are not handled correct under windows. Fix: private void addResources(ResourceManagerImpl resources, URL themeUrl, String prefix, int skipPrefix) throws IOException, ServletException { String fileName = themeUrl.toString(); int index = fileName.indexOf("!"); String protocol = themeUrl.getProtocol(); if (index != -1) { fileName = fileName.substring(protocol.length() + 1, index); } if (LOG.isInfoEnabled()) { LOG.info("Adding resources from fileName='"+fileName + "' prefix='" + prefix + "' skip=" + skipPrefix + ""); } // JBoss 5.0.0 introduced vfszip protocol if (!protocol.equals("vfszip") && fileName.endsWith(META_INF_TOBAGO_THEME_XML)) { try { URI uri = themeUrl.toURI(); File tobagoThemeXml = new File(uri); File directoryFile = tobagoThemeXml.getParentFile().getParentFile(); String resourcePath = ""; resolveTheme(resources, directoryFile, resourcePath, prefix, false); } catch (URISyntaxException e) { LOG.error("", e); } } else { URL jarFile; try { // JBoss 5.0.0 introduced vfszip protocol if (protocol.equals("vfszip")) { fileName = new File(fileName).getParentFile().getParentFile().getPath(); if (File.separatorChar == '\\' && fileName.contains("\\")) { fileName = fileName.replace('\\', '/'); LOG.info("Fixed slashes for virtual filesystem protocoll on windows system: " + fileName); } } jarFile = new URL(fileName); } catch (MalformedURLException e) { // workaround for weblogic on windows jarFile = new URL("file:" + fileName); } InputStream stream = null; ZipInputStream zipStream = null; try { stream = jarFile.openStream(); zipStream = new ZipInputStream(stream); while (zipStream.available() > 0) { ZipEntry nextEntry = zipStream.getNextEntry(); if (nextEntry == null || nextEntry.isDirectory()) { continue; } String name = "/" + nextEntry.getName(); if (name.startsWith(prefix)) { addResource(resources, name, skipPrefix); } } } finally { IOUtils.closeQuietly(stream); IOUtils.closeQuietly(zipStream); } } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.