• Post Reply Bookmark Topic Watch Topic
  • New Topic

if statement with Apache commons upload  RSS feed

 
frank braunstein
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello people,

can someone explain me why this if statement is not entered?


While this -without the second item.getContentType- IS entered?

I want the if statement to be entered only when item is a gif png or jpeg. It seems like the || operator blows up the whole if block.

UPDATE:
I found the mistake. I have to wrap the item.getContentType().equals("image/jpeg") in bracket together with item.getContentType().equals("image/gif") etc. .
Sorry!
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37253
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank,
Thanks for posting that you found it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!