hi rene,

this may help or not ... ;-)

i am not 100% sure, but i think, that ivy's URLResolver parses
DirectoryListings. preconditions for  URLResolvers  to work 
would be:

- DirectoryListings must be enabled on server
-  DirectoryListings must have the appropriate format 

enable DirectoryListings for tomcat like this:

<servlet>  
  <init-param>  
    <param-name>listings</param-name>  
    <param-value>true</param-value>  
  </init-param>  
</servlet>


2 excerpts from ivy-source:

*******************************************************************************
org.apache.ivy.util.url.ApacheURLLister
*******************************************************************************

package org.apache.ivy.util.url;

public class ApacheURLLister {
...
    private static final Pattern PATTERN = Pattern.compile(
        "<a[^>]*href=\"([^\"]*)\"[^>]*>(?:<[^>]+>)*?([^<>]+?)(?:<[^>]+>)*?
",
        Pattern.CASE_INSENSITIVE);
        
    public List retrieveListing(URL url, boolean includeFiles, boolean
includeDirectories)
            throws IOException {
        List urlList = new ArrayList();

        // add trailing slash for relative urls
        if (!url.getPath().endsWith("/") &&
!url.getPath().endsWith(".html")) {
            url = new URL(url.getProtocol(), url.getHost(), url.getPort(),
url.getPath() + "/");
        }

        BufferedReader r = new BufferedReader(new
InputStreamReader(URLHandlerRegistry.getDefault()
                .openStream(url)));

        String htmlText = FileUtil.readEntirely(r);

        Matcher matcher = PATTERN.matcher(htmlText);

        while (matcher.find()) {
            // get the href text and the displayed text
            String href = matcher.group(1);
            String text = matcher.group(2);
            ...
               }
        }               
...
}


*******************************************************************************
org.apache.ivy.plugins.repository.url.URLResource
*******************************************************************************

package org.apache.ivy.plugins.repository.url;

public class URLResource implements Resource {
...
    private void init() {
        URLInfo info = URLHandlerRegistry.getDefault().getURLInfo(url);
        contentLength = info.getContentLength();
        lastModified = info.getLastModified();
        exists = info.isReachable();
        init = true;
    }
...
}

grĂ¼sse
-- 
View this message in context: 
http://gradle.1045684.n5.nabble.com/question-about-urlresolver-tp3259653p3273887.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to