You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Michael Christoff <Mi...@camh.net> on 2007/02/16 20:43:01 UTC

Application level side effects of new exists() behaviour, plus: Slide dev list archive link not working

I was wondering if someone here has the ability to fix the Slide dev mailing list archive.  Its listed as being at this URL:

http://mail-archives.eu.apache.org/mod_mbox/jakarta-slide-dev/

However, at least from within my company network, I get a "The server at mail-archives.apache.org is taking too long to respond" error when I try to access it.

---

As for application level side-effects of the new exists() method behaviour:

Updating the propfindMethod method may introduce errors in users' code if they had 'coded around' the old behaviour of exists(). This may be something to consider when updating the API. For example: Although I haven't noticed any with respect to the behaviour of the Slide client API itself, I have found some issues relating to my own application. The code below is based on a some code from my app:

---

WebdavResource wdrMyFile = null;
boolean myFileDoesNotExist = false;

try {
	
	wdrMyFile = new WebdavResource(myFileHttpURL);

} catch(Exception e) {

	myFileDoesNotExist = true;

}

if(myFileDoesNotExist)
{
	System.out.println("Network error or file does not exist");
	return;
}

...

---

As you can see, I hadn't been checking the status code to see if it was a 404 error that caused the problem.  While this will work with the old behaviour of WebdavResource, it will obviously not work with the new behaviour since the try block will no longer throw an exception so myFileDoesNotExist will be false.  However, wdrMyFile.exists() may also be false--introducing a bug in my code.  I hadn't noticed the potential problem while running the code since the simple tests I did never encountered a non-existent file.  If they had, my program would behaved incorrectly.

I've been going through my code line by line to find such situations.  The way one would need to code this so that it works for both versions of WebdavResource would be something like:

---

WebdavResource wdrMyFile = null;
boolean myFileDoesNotExist = false;
boolean networkError = false;

try {
	
	wdrMyFile = new WebdavResource(myFileHttpURL);

} catch(HttpException httpe) {

	if(httpe.getReasonCode() == HttpStatus.SC_NOT_FOUND)
		myFileDoesNotExist = true;
	else
		networkError = true;

} catch(IOException ioe) {

	networkError = true;

}

if(myFileDoesNotExist || !wdrMyFile.exists())
{
	System.out.println("File does not exist");
	return;
}

if(networkError)
{
	System.out.println("Network Error");
	return;
}

...

---

But as you can see, this can unfortunately be a bit of pain to code.



Cheers!



Michael N. Christoff
dmx_dawg@hotmail.com


-mike


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


RE: Application level side effects of new exists() behaviour, plus: Slide dev list archive link not working

Posted by Michael Christoff <Mi...@camh.net>.
> Thanx for the pointer. I fixed the links on the
> mail2.html page.
> The correct url is : 
> http://mail-archives.apache.org/mod_mbox/jakarta-slide-dev/

No problem and thanks for updating the link.


Cheers,

-mike



Michael N. Christoff
Site Administrator
Continuing Professional Education Online
Centre for Addiction and Mental Health
33 Russell Street
Toronto, Ontario M5S 2S1


 


-----Original Message-----
From: Martin van den Bemt [mailto:mllist@mvdb.net]
Sent: February 17, 2007 7:41 PM
To: Slide Developers Mailing List
Subject: Re: Application level side effects of new exists() behaviour,
plus: Slide dev list archive link not working


Thanx for the pointer. I fixed the links on the mail2.html page.
The correct url is : http://mail-archives.apache.org/mod_mbox/jakarta-slide-dev/

Mvgr,
Martin

Michael Christoff wrote:
> I was wondering if someone here has the ability to fix the Slide dev mailing list archive.  Its listed as being at this URL:
> 
> http://mail-archives.eu.apache.org/mod_mbox/jakarta-slide-dev/
> 
> However, at least from within my company network, I get a "The server at mail-archives.apache.org is taking too long to respond" error when I try to access it.
> 
> ---
> 
> As for application level side-effects of the new exists() method behaviour:
> 
> Updating the propfindMethod method may introduce errors in users' code if they had 'coded around' the old behaviour of exists(). This may be something to consider when updating the API. For example: Although I haven't noticed any with respect to the behaviour of the Slide client API itself, I have found some issues relating to my own application. The code below is based on a some code from my app:
> 
> ---
> 
> WebdavResource wdrMyFile = null;
> boolean myFileDoesNotExist = false;
> 
> try {
> 	
> 	wdrMyFile = new WebdavResource(myFileHttpURL);
> 
> } catch(Exception e) {
> 
> 	myFileDoesNotExist = true;
> 
> }
> 
> if(myFileDoesNotExist)
> {
> 	System.out.println("Network error or file does not exist");
> 	return;
> }
> 
> ...
> 
> ---
> 
> As you can see, I hadn't been checking the status code to see if it was a 404 error that caused the problem.  While this will work with the old behaviour of WebdavResource, it will obviously not work with the new behaviour since the try block will no longer throw an exception so myFileDoesNotExist will be false.  However, wdrMyFile.exists() may also be false--introducing a bug in my code.  I hadn't noticed the potential problem while running the code since the simple tests I did never encountered a non-existent file.  If they had, my program would behaved incorrectly.
> 
> I've been going through my code line by line to find such situations.  The way one would need to code this so that it works for both versions of WebdavResource would be something like:
> 
> ---
> 
> WebdavResource wdrMyFile = null;
> boolean myFileDoesNotExist = false;
> boolean networkError = false;
> 
> try {
> 	
> 	wdrMyFile = new WebdavResource(myFileHttpURL);
> 
> } catch(HttpException httpe) {
> 
> 	if(httpe.getReasonCode() == HttpStatus.SC_NOT_FOUND)
> 		myFileDoesNotExist = true;
> 	else
> 		networkError = true;
> 
> } catch(IOException ioe) {
> 
> 	networkError = true;
> 
> }
> 
> if(myFileDoesNotExist || !wdrMyFile.exists())
> {
> 	System.out.println("File does not exist");
> 	return;
> }
> 
> if(networkError)
> {
> 	System.out.println("Network Error");
> 	return;
> }
> 
> ...
> 
> ---
> 
> But as you can see, this can unfortunately be a bit of pain to code.
> 
> 
> 
> Cheers!
> 
> 
> 
> Michael N. Christoff
> dmx_dawg@hotmail.com
> 
> 
> -mike
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
> 
> 
> 

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


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


Re: Application level side effects of new exists() behaviour, plus: Slide dev list archive link not working

Posted by Martin van den Bemt <ml...@mvdb.net>.
Thanx for the pointer. I fixed the links on the mail2.html page.
The correct url is : http://mail-archives.apache.org/mod_mbox/jakarta-slide-dev/

Mvgr,
Martin

Michael Christoff wrote:
> I was wondering if someone here has the ability to fix the Slide dev mailing list archive.  Its listed as being at this URL:
> 
> http://mail-archives.eu.apache.org/mod_mbox/jakarta-slide-dev/
> 
> However, at least from within my company network, I get a "The server at mail-archives.apache.org is taking too long to respond" error when I try to access it.
> 
> ---
> 
> As for application level side-effects of the new exists() method behaviour:
> 
> Updating the propfindMethod method may introduce errors in users' code if they had 'coded around' the old behaviour of exists(). This may be something to consider when updating the API. For example: Although I haven't noticed any with respect to the behaviour of the Slide client API itself, I have found some issues relating to my own application. The code below is based on a some code from my app:
> 
> ---
> 
> WebdavResource wdrMyFile = null;
> boolean myFileDoesNotExist = false;
> 
> try {
> 	
> 	wdrMyFile = new WebdavResource(myFileHttpURL);
> 
> } catch(Exception e) {
> 
> 	myFileDoesNotExist = true;
> 
> }
> 
> if(myFileDoesNotExist)
> {
> 	System.out.println("Network error or file does not exist");
> 	return;
> }
> 
> ...
> 
> ---
> 
> As you can see, I hadn't been checking the status code to see if it was a 404 error that caused the problem.  While this will work with the old behaviour of WebdavResource, it will obviously not work with the new behaviour since the try block will no longer throw an exception so myFileDoesNotExist will be false.  However, wdrMyFile.exists() may also be false--introducing a bug in my code.  I hadn't noticed the potential problem while running the code since the simple tests I did never encountered a non-existent file.  If they had, my program would behaved incorrectly.
> 
> I've been going through my code line by line to find such situations.  The way one would need to code this so that it works for both versions of WebdavResource would be something like:
> 
> ---
> 
> WebdavResource wdrMyFile = null;
> boolean myFileDoesNotExist = false;
> boolean networkError = false;
> 
> try {
> 	
> 	wdrMyFile = new WebdavResource(myFileHttpURL);
> 
> } catch(HttpException httpe) {
> 
> 	if(httpe.getReasonCode() == HttpStatus.SC_NOT_FOUND)
> 		myFileDoesNotExist = true;
> 	else
> 		networkError = true;
> 
> } catch(IOException ioe) {
> 
> 	networkError = true;
> 
> }
> 
> if(myFileDoesNotExist || !wdrMyFile.exists())
> {
> 	System.out.println("File does not exist");
> 	return;
> }
> 
> if(networkError)
> {
> 	System.out.println("Network Error");
> 	return;
> }
> 
> ...
> 
> ---
> 
> But as you can see, this can unfortunately be a bit of pain to code.
> 
> 
> 
> Cheers!
> 
> 
> 
> Michael N. Christoff
> dmx_dawg@hotmail.com
> 
> 
> -mike
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
> 
> 
> 

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