You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by "Koundinya (Sudhakar Chavali)" <su...@yahoo.com> on 2004/06/11 10:30:22 UTC

URL Parsing Problem

Hello All,

Here is the scenario

I am using Slide project to access MS-Exchange Server mails.

In MS Exchange Server API, the mails will be created with their subjects.If the mail subject is
Test#10 for an example it creates Test#10.eml object in ms exchange server.

if i use the following procedure to create the mail object, url is not building properly and i am
getting the wrong out put
url = new org.apache.commons.httpclient.HttpURL(username, password,
            hostname, port, strPath);

for an example if this is the URL
http://comp62/exchange/Administrator/Inbox/Test%20#123.EML

and passed to the HttpURL , output object i am getting is
http://comp62/exchange/Administrator/Inbox/Test%20 which is not the correct one. So i am not able
to download the mails from ms exchange server because of this problem. Is this the bug in slide?
or do i need to use any other procedure to build the object.

Thanks
Sudhakar

=====
"No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 

"Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)

"It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: URL Parsing Problem

Posted by Simone Gianni <s....@thebug.it>.
Hi Koundinya,

If there is a "special character" inside your url, it's escaped putting 
a % sign followed by two digits HEX code of the char, in standard ASCII. 
This mesans that if i put a space in a URL, like 
"http://www.server.com/folder/name with space.html" i will obtain 
"http://www.server.com/folder/name%20with%20space.html". This is because 
in ascii the space is char 32, and 32 in hex is 20.

Obviously, if you have in an unescaped path a % sign, that will get 
escaped too, to distinguish between a real % in a file name and an 
escape sequence. So, since % char code in ascii is 37, in hex is 25, and 
you will obtain a %25.

In your first reply you wrote :
http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%%23123.EML

Which gets escaped because there are two % signs, and gets escaped as 
%25, followed by 23123. In the second mail you used a single % sign, and 
you got it escaped again, and this time maybe it's a bug.

Could you please double check that you are inputting a single % in your url?

Simone Gianni


Koundinya (Sudhakar Chavali) wrote:

>Hi Julian,
>
>I did similary the way you have explained but
>
>instead of taking the same information, it has built the new url
>
>The value I inputted is http://ads.exchange:80/Exchange/Administrator/S
>ent%20Items/Test%20%23123.EML
>
>
>
>Here is the output
>http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%2523123.EML
>
>Actaully it is encoding % value to %25 :(
>thanks
>sudhakar
>
> 
>
>
>
>--- "Koundinya (Sudhakar Chavali)" <su...@yahoo.com> wrote:
>  
>
>>Hi Julian,
>>
>>I did similary the way you have explained but
>>
>>instead of taking the same information, it has built the new url
>>
>>The value I inputted is http://ads.exchange:80/Exchange/Administrator/S
>>ent%20Items/Test%20%%23123.EML
>>
>>Here is the output
>>http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%2523123.EML
>>
>>thanks
>>sudhakar
>>--- Julian Reschke <ju...@gmx.de> wrote:
>>    
>>
>>>Koundinya (Sudhakar Chavali) wrote:
>>>
>>>      
>>>
>>>>Hello All,
>>>>
>>>>Here is the scenario
>>>>
>>>>I am using Slide project to access MS-Exchange Server mails.
>>>>
>>>>In MS Exchange Server API, the mails will be created with their subjects.If the mail subject
>>>>        
>>>>
>>>is
>>>      
>>>
>>>>Test#10 for an example it creates Test#10.eml object in ms exchange server.
>>>>
>>>>if i use the following procedure to create the mail object, url is not building properly and
>>>>        
>>>>
>>i
>>    
>>
>>>am
>>>      
>>>
>>>>getting the wrong out put
>>>>url = new org.apache.commons.httpclient.HttpURL(username, password,
>>>>            hostname, port, strPath);
>>>>
>>>>for an example if this is the URL
>>>>http://comp62/exchange/Administrator/Inbox/Test%20#123.EML
>>>>        
>>>>
>>>This is an absolute HTTP URL 
>>>("http://comp62/exchange/Administrator/Inbox/Test%20") plus a fragment 
>>>identifier ("#123.EML").
>>>
>>>You probably need: 
>>>"http://comp62/exchange/Administrator/Inbox/Test%20%23123.EML"
>>>
>>> > ...
>>>
>>>Best regards, Julian
>>>
>>>-- 
>>><green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: slide-user-help@jakarta.apache.org
>>>
>>>      
>>>
>>=====
>>"No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 
>>
>>"Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)
>>
>>"It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)
>>
>>
>>	
>>		
>>__________________________________
>>Do you Yahoo!?
>>Friends.  Fun.  Try the all-new Yahoo! Messenger.
>>http://messenger.yahoo.com/ 
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: slide-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>=====
>"No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 
>
>"Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)
>
>"It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)
>
>
>	
>		
>__________________________________
>Do you Yahoo!?
>Friends.  Fun.  Try the all-new Yahoo! Messenger.
>http://messenger.yahoo.com/ 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: slide-user-help@jakarta.apache.org
>
>  
>

Re: URL Parsing Problem

Posted by Ingo Brunberg <ib...@fiz-chemie.de>.
Are you talking about the encoding done in the client library? That is
handled by the Httpclient libs.

As Julian already mentioned the '#' in the URL usually serves as a
fragment identifier. Hence I am not sure if the URL that Microsoft
produces is really a valid one. At least it was not a lucky decision.

You did not state explicitly what you have tried so far, but you could
try to create a HttpUrl with an escaped path. I am just not sure that
Httpclient does not check the validity regardless of the explicit
passing of an escaped URL.

Ingo

> I got this problem from Slide API only. After that I tried to manipulate with java.net.URlDecoder
> and java.net.URLEncoder but there also i have failed to parse correctly.
> 
> I just struck at this point :((
> 
> 
> 
> 
> --- Julian Reschke <ju...@gmx.de> wrote:
> > Koundinya (Sudhakar Chavali) wrote:
> > > Hi Julian,
> > > 
> > > I did similary the way you have explained but
> > > 
> > > instead of taking the same information, it has built the new url
> > > 
> > > The value I inputted is http://ads.exchange:80/Exchange/Administrator/S
> > > ent%20Items/Test%20%23123.EML
> > > 
> > > 
> > > 
> > > Here is the output
> > > http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%2523123.EML
> > > 
> > > Actaully it is encoding % value to %25 :(
> > > thanks
> > > sudhakar
> > 
> > OK, that looks like a bug. Is this a JDK method or Slide?
> > 
> > -- 
> > <green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: slide-user-help@jakarta.apache.org
> > 
> 
> 
> =====
> "No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 
> 
> "Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)
> 
> "It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/ 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: URL Parsing Problem

Posted by "Koundinya (Sudhakar Chavali)" <su...@yahoo.com>.
I got this problem from Slide API only. After that I tried to manipulate with java.net.URlDecoder
and java.net.URLEncoder but there also i have failed to parse correctly.

I just struck at this point :((




--- Julian Reschke <ju...@gmx.de> wrote:
> Koundinya (Sudhakar Chavali) wrote:
> > Hi Julian,
> > 
> > I did similary the way you have explained but
> > 
> > instead of taking the same information, it has built the new url
> > 
> > The value I inputted is http://ads.exchange:80/Exchange/Administrator/S
> > ent%20Items/Test%20%23123.EML
> > 
> > 
> > 
> > Here is the output
> > http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%2523123.EML
> > 
> > Actaully it is encoding % value to %25 :(
> > thanks
> > sudhakar
> 
> OK, that looks like a bug. Is this a JDK method or Slide?
> 
> -- 
> <green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 


=====
"No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 

"Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)

"It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: URL Parsing Problem

Posted by Julian Reschke <ju...@gmx.de>.
Koundinya (Sudhakar Chavali) wrote:
> Hi Julian,
> 
> I did similary the way you have explained but
> 
> instead of taking the same information, it has built the new url
> 
> The value I inputted is http://ads.exchange:80/Exchange/Administrator/S
> ent%20Items/Test%20%23123.EML
> 
> 
> 
> Here is the output
> http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%2523123.EML
> 
> Actaully it is encoding % value to %25 :(
> thanks
> sudhakar

OK, that looks like a bug. Is this a JDK method or Slide?

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: URL Parsing Problem

Posted by "Koundinya (Sudhakar Chavali)" <su...@yahoo.com>.
Hi Julian,

I did similary the way you have explained but

instead of taking the same information, it has built the new url

The value I inputted is http://ads.exchange:80/Exchange/Administrator/S
ent%20Items/Test%20%23123.EML



Here is the output
http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%2523123.EML

Actaully it is encoding % value to %25 :(
thanks
sudhakar

 



--- "Koundinya (Sudhakar Chavali)" <su...@yahoo.com> wrote:
> Hi Julian,
> 
> I did similary the way you have explained but
> 
> instead of taking the same information, it has built the new url
> 
> The value I inputted is http://ads.exchange:80/Exchange/Administrator/S
> ent%20Items/Test%20%%23123.EML
> 
> Here is the output
> http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%2523123.EML
> 
> thanks
> sudhakar
> --- Julian Reschke <ju...@gmx.de> wrote:
> > Koundinya (Sudhakar Chavali) wrote:
> > 
> > > Hello All,
> > > 
> > > Here is the scenario
> > > 
> > > I am using Slide project to access MS-Exchange Server mails.
> > > 
> > > In MS Exchange Server API, the mails will be created with their subjects.If the mail subject
> > is
> > > Test#10 for an example it creates Test#10.eml object in ms exchange server.
> > > 
> > > if i use the following procedure to create the mail object, url is not building properly and
> i
> > am
> > > getting the wrong out put
> > > url = new org.apache.commons.httpclient.HttpURL(username, password,
> > >             hostname, port, strPath);
> > > 
> > > for an example if this is the URL
> > > http://comp62/exchange/Administrator/Inbox/Test%20#123.EML
> > 
> > This is an absolute HTTP URL 
> > ("http://comp62/exchange/Administrator/Inbox/Test%20") plus a fragment 
> > identifier ("#123.EML").
> > 
> > You probably need: 
> > "http://comp62/exchange/Administrator/Inbox/Test%20%23123.EML"
> > 
> >  > ...
> > 
> > Best regards, Julian
> > 
> > -- 
> > <green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: slide-user-help@jakarta.apache.org
> > 
> 
> 
> =====
> "No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 
> 
> "Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)
> 
> "It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/ 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 


=====
"No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 

"Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)

"It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: URL Parsing Problem

Posted by "Koundinya (Sudhakar Chavali)" <su...@yahoo.com>.
Hi Julian,

I did similary the way you have explained but

instead of taking the same information, it has built the new url

The value I inputted is http://ads.exchange:80/Exchange/Administrator/S
ent%20Items/Test%20%%23123.EML

Here is the output
http://ads.exchange:80/Exchange/Administrator/Sent%20Items/Test%20%2523123.EML

thanks
sudhakar
--- Julian Reschke <ju...@gmx.de> wrote:
> Koundinya (Sudhakar Chavali) wrote:
> 
> > Hello All,
> > 
> > Here is the scenario
> > 
> > I am using Slide project to access MS-Exchange Server mails.
> > 
> > In MS Exchange Server API, the mails will be created with their subjects.If the mail subject
> is
> > Test#10 for an example it creates Test#10.eml object in ms exchange server.
> > 
> > if i use the following procedure to create the mail object, url is not building properly and i
> am
> > getting the wrong out put
> > url = new org.apache.commons.httpclient.HttpURL(username, password,
> >             hostname, port, strPath);
> > 
> > for an example if this is the URL
> > http://comp62/exchange/Administrator/Inbox/Test%20#123.EML
> 
> This is an absolute HTTP URL 
> ("http://comp62/exchange/Administrator/Inbox/Test%20") plus a fragment 
> identifier ("#123.EML").
> 
> You probably need: 
> "http://comp62/exchange/Administrator/Inbox/Test%20%23123.EML"
> 
>  > ...
> 
> Best regards, Julian
> 
> -- 
> <green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 


=====
"No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 

"Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)

"It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: URL Parsing Problem

Posted by Julian Reschke <ju...@gmx.de>.
Koundinya (Sudhakar Chavali) wrote:

> Hello All,
> 
> Here is the scenario
> 
> I am using Slide project to access MS-Exchange Server mails.
> 
> In MS Exchange Server API, the mails will be created with their subjects.If the mail subject is
> Test#10 for an example it creates Test#10.eml object in ms exchange server.
> 
> if i use the following procedure to create the mail object, url is not building properly and i am
> getting the wrong out put
> url = new org.apache.commons.httpclient.HttpURL(username, password,
>             hostname, port, strPath);
> 
> for an example if this is the URL
> http://comp62/exchange/Administrator/Inbox/Test%20#123.EML

This is an absolute HTTP URL 
("http://comp62/exchange/Administrator/Inbox/Test%20") plus a fragment 
identifier ("#123.EML").

You probably need: 
"http://comp62/exchange/Administrator/Inbox/Test%20%23123.EML"

 > ...

Best regards, Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org