Author: alessio.soldano(a)jboss.com
Date: 2009-05-11 05:01:58 -0400 (Mon, 11 May 2009)
New Revision: 10029
Modified:
framework/branches/jbossws-framework-3.1.2.SP1/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java
Log:
[JBWS-2619] Committing Daniel's patch for ".."/"." issue
Modified:
framework/branches/jbossws-framework-3.1.2.SP1/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java
===================================================================
---
framework/branches/jbossws-framework-3.1.2.SP1/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java 2009-05-11
07:48:31 UTC (rev 10028)
+++
framework/branches/jbossws-framework-3.1.2.SP1/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java 2009-05-11
09:01:58 UTC (rev 10029)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Iterator;
import java.util.List;
import org.jboss.logging.Logger;
@@ -43,9 +42,9 @@
private ArchiveDeployment parent;
// The root file for this deployment
private UnifiedVirtualFile rootFile;
-
+
private static Logger log = Logger.getLogger(ArchiveDeploymentImpl.class);
-
+
private List<UnifiedVirtualFile> metadataFiles;
ArchiveDeploymentImpl(String simpleName, ClassLoader classLoader)
@@ -116,51 +115,45 @@
{
log.debug("Cannot get " + resourcePath + " from root
file, trying with additional metadata files", e);
}
-
+
}
}
//scan additional metadata files (for instance originally attached to a
VFSDeploymentUnit)
if (resourceURL == null && metadataFiles != null &&
!metadataFiles.isEmpty())
{
UnifiedVirtualFile vfResource = null;
- for (Iterator<UnifiedVirtualFile> it = getMetadataFiles().iterator();
it.hasNext() && vfResource == null;)
+ for (UnifiedVirtualFile metadataFile : getMetadataFiles())
{
- UnifiedVirtualFile uvf = it.next();
- URL wsdlUrl = uvf.toURL();
- String wsdlPath = wsdlUrl.getPath();
- if (wsdlPath.startsWith("/"))
- wsdlPath = wsdlPath.substring(1);
- if (resourcePath.equals(wsdlPath))
+ try
{
- vfResource = uvf;
- }
- else
- {
- try
+ UnifiedVirtualFile child = metadataFile.findChild(resourcePath);
+ if (child != null)
{
- vfResource = uvf.findChild(resourcePath);
+ vfResource = child;
+ break;
}
- catch (IOException e)
- {
- log.debug("Cannot get " + resourcePath + " from
" + uvf, e);
- }
}
+ catch (IOException e)
+ {
+ log.debug("Cannot get " + resourcePath + " from " +
metadataFile, e);
+ }
}
+
if (vfResource == null)
throw new IOException("Could not find " + resourcePath + "
in the additional metadatafiles!");
-
+
resourceURL = vfResource.toURL();
}
}
return resourceURL;
}
-
+
public List<UnifiedVirtualFile> getMetadataFiles()
{
return metadataFiles;
}
-
+
public void setMetadataFiles(List<UnifiedVirtualFile> metadataFiles)
{
this.metadataFiles = metadataFiles;
Show replies by date