tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r526530 - /incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java
Date Sun, 08 Apr 2007 05:52:29 GMT
Author: lresende
Date: Sat Apr  7 22:52:28 2007
New Revision: 526530

URL: http://svn.apache.org/viewvc?view=rev&rev=526530
Log:
Handling mapping files qithout extension

Modified:
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java?view=diff&rev=526530&r1=526529&r2=526530
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java
(original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/services/spi/contribution/DefaultURLArtifactProcessorRegistry.java
Sat Apr  7 22:52:28 2007
@@ -39,11 +39,16 @@
     }
 
     public Object read(URL source) throws ContributionReadException {
+        URLArtifactProcessor<Object> processor = null;
         
         // Delegate to the processor associated with file extension
         String extension = source.getFile();
-        extension = extension.substring(extension.lastIndexOf('.'));
-        URLArtifactProcessor<Object> processor = (URLArtifactProcessor<Object>)this.getProcessor(extension);
+        int extensionStart = extension.lastIndexOf('.');
+        //handle files without extension (e.g NOTICE)
+        if(extensionStart > 0){
+            extension = extension.substring(extensionStart);
+            processor = (URLArtifactProcessor<Object>)this.getProcessor(extension);
           
+        }
         if (processor == null) {
             return null;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message