lookfirst / sardine

an easy to use webdav client for java
Other
579 stars 185 forks source link

Fixed Quota Request Bug (NullPointerException) when the resource is N… #229

Closed rafox2005 closed 2 years ago

rafox2005 commented 9 years ago

Fixed Quota Request Bug (NullPointerException) when the resource is Not Found. Now, it checks if the resource is OK (200) before creating the DavQuota object

Because the Webdav Quota property is optional. I was having a problem (NullPointerException) with a 404 response from a server when I required the properties. Now I changed the code to check if the response if 200 (OK) before creating the DavQuota object.

Maybe the way I fixed this issue is not the best, but it works ;)

dankarp commented 9 years ago

.contains("200") is probably not the right way to do this.

If we take pull request #230, could we wrap the Response in a DavResource, check its getStatusCode() , and pass the DavResource to the DavQuota constructor?

rafox2005 commented 9 years ago

Great feedback @dankarp. Is it okay now?

Thanks!

dkocher commented 8 years ago

Can you please rebase with master to fix the tests.