Author: mcculls
Date: Sat Aug  2 10:30:28 2008
New Revision: 682021

URL: http://svn.apache.org/viewvc?rev=682021&view=rev
Log:
FELIX-553: revert to use -DprefixURL=http://... to specify repository prefix, 
inline with other changes for 1.4.2

Modified:
    
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java

Modified: 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java?rev=682021&r1=682020&r2=682021&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrRemoteClean.java
 Sat Aug  2 10:30:28 2008
@@ -82,6 +82,13 @@
     private boolean ignoreLock;
     
     /**
+     * Public URL prefix for the remote repository.
+     *
+     * @parameter expression="${prefixURL}"
+     */
+    private String prefixURL;
+
+    /**
      * Remote OBR Repository.
      * 
      * @parameter expression="${remoteOBR}" default-value="NONE"
@@ -172,6 +179,10 @@
 
         RemoteFileManager remoteFile = new RemoteFileManager( m_wagonManager, 
settings, log );
         openRepositoryConnection( remoteFile );
+        if ( null == prefixURL || prefixURL.trim().length() == 0 )
+        {
+            prefixURL = remoteFile.toString();
+        }
 
         // ======== LOCK REMOTE OBR ========
         log.info( "LOCK " + remoteFile + '/' + repositoryName );
@@ -191,7 +202,7 @@
 
             // Clean the downloaded file.
             Document doc = parseFile(new File(repositoryXml), 
initConstructor());
-            Node finalDocument = cleanDocument(tempURI, 
doc.getDocumentElement());
+            Node finalDocument = cleanDocument(doc.getDocumentElement());
             
             if ( finalDocument == null )
             {
@@ -262,7 +273,7 @@
      * @param elem : the input XML tree
      * @return the cleaned XML tree
      */
-    private Element cleanDocument( URI prefix, Element elem )
+    private Element cleanDocument( Element elem )
     {
         NodeList nodes = elem.getElementsByTagName( "resource" );
         List toRemove = new ArrayList();
@@ -275,7 +286,7 @@
 
             URL url;
             try {
-                url = new URL(prefix.toURL(), value);
+                url = new URL(prefixURL + '/' + value);
             } catch (MalformedURLException e) {
                 getLog().error("Malformed URL when creating the resource 
absolute URI : " + e.getMessage());
                 return null;


Reply via email to