Hello Everyone, I have a rather odd problem, and I and I was hoping the slide Gurus could help me out.
I'm finally making the transition to a more recent build of the slide 2.0 libraries because I am getting
an infinite folder problem with folders/collections that have characters such as '&',',' and '.' and I was
hoping this would resolve the problem, but alas I have another problem now where, the url with the port is
getting changed.


Like many of you, I have tomcat running on port 8080, with the old versions of the slide/http jars my URLs were
correct after calling either listCollections or getChildResources, but now it's changing the url...in the following
way.


Correct URL:
http://localhost:8080/a1/.....
Child Resources Returns:
http://localhost8080:8080/a1/....

Note that 8080 now appears twice in the url, and my machine name has effectively been changed to
"localhost8080" not "localhost"


Has anyone else seen this problem?

I have attached some example code which might be helpful to other newbies working with slide,
as well as a way to see what I'm talking about....



Thanks for your help!!!!!


One other note is the difference in the way the old jars behaved vs. the new, the old jars returned the parent+children, the
new stuff just returns the children (this is actually much better).



New Jars (Version 2.0 (Milestone Release) from 4/27/04) ------------------------------------------------------------- http://localhost8080:8080/a1/My%20Reports/Results/SQL%20line%20items%20Out0003/invoiceNumber/100000/SQL%20line%20items%20Out0003%2004-09-2004%2008-54-53-730%5B1%5D.pdf

Display Name: 100000

Children returned: 1

SQL line items Out0003 04-09-2004 08-54-53-730[1].pdf

http://localhost8080:8080/a1/My%20Reports/Results/SQL%20line%20items%20Out0003/invoiceNumber/100000/SQL%20line%20items%20Out0003%2004-09-2004%2008-54-53-730%5B1%5D.pdf

Admin:password


Old Jars (version 2.0 from CVS 1/7/04)
-------------------------------------------------------------
http://Admin:[EMAIL PROTECTED]:8080/a1/My Reports/Results/SQL line items Out0003/invoiceNumber/100000/100000


http://Admin:[EMAIL PROTECTED]:8080/a1/My Reports/Results/SQL line items Out0003/invoiceNumber/100000/SQL%20line%20items%20Out0003%2004-09-2004%2008-54-53-730%5B1%5D.pdf

Display Name:

Children returned: 2

100000

http://Admin:[EMAIL PROTECTED]:8080/a1/My Reports/Results/SQL line items Out0003/invoiceNumber/100000/100000

Admin:password

SQL line items Out0003 04-09-2004 08-54-53-730[1].pdf

http://Admin:[EMAIL PROTECTED]:8080/a1/My Reports/Results/SQL line items Out0003/invoiceNumber/100000/SQL%20line%20items%20Out0003%2004-09-2004%2008-54-53-730%5B1%5D.pdf

Admin:password


-------------------------------- Test2.txt (It's currently setup to run with the latest milestone jars)

//OLD Jars from 1/6/04
/*
import org.apache.util.HttpURL;
import org.apache.webdav.lib.WebdavResource;
import org.apache.webdav.lib.WebdavResources;
import java.util.Enumeration;
*/


//New Jars structure....from 4/27/04 import org.apache.commons.httpclient.HttpURL; import org.apache.commons.httpclient.URIException; import org.apache.webdav.lib.WebdavResource; import org.apache.commons.httpclient.HttpException; import java.io.IOException; import java.util.Enumeration; import org.apache.webdav.lib.WebdavResources;


public class Test2
{
public Test2() throws Exception
{
HttpURL url = new HttpURL("http://localhost:8080/a1/My Reports/Results/SQL line items Out0003/invoiceNumber/100000");


   //old Http url uses uppercase "I" in setUserInfo
   //url.setUserInfo("Admin","password");

   //new HTTPURL requires lower case "i" in setUserinfo
   url.setUserinfo("Admin","password");

WebdavResource wdResource=new WebdavResource(url);

WebdavResources wdResources=wdResource.getChildResources();
Enumeration resourceEnumeration=wdResources.getResources();
while(resourceEnumeration.hasMoreElements())
{
WebdavResource tempResource=((WebdavResource) resourceEnumeration.nextElement());
System.out.println(tempResource.getHttpURL());
}




   System.out.println("Display Name: " + wdResource.getDisplayName());
   WebdavResource[] webdavList=null;
   webdavList=wdResource.listWebdavResources();
   System.out.println("Children returned: " + webdavList.length);

   for(int idx=0; idx<webdavList.length;idx++)
   {
     System.out.println("\t" + webdavList[idx].getDisplayName());
     System.out.println("\t" + webdavList[idx].getHttpURL());

//Old Httpurl has a getUserInfo command...
//System.out.println("\t"+ webdavList[idx].getHttpURL().getUserInfo());


     //New Httpurl has
     System.out.println("\t"+ webdavList[idx].getHttpURL().getUserinfo());

}

}

 public static void main(String[] args) throws Exception
 {
   new Test2();
 }
}

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to