finally { if (imageInputStream != null) { try { imageInputStream.close(); } catch (IOException e) {  } } }
	Image(String name, boolean isRepresentsSubdirectory, Folder folder,			IImageAccessor imageAccessor, ThumbNailInfo thumbNailInfo)			throws GalleryException	{		this.name = name;		this.folder = folder;		this.isRepresentsSubdirectory = isRepresentsSubdirectory;		this.thumbNailInfo = thumbNailInfo;		lastModified = imageAccessor.getLastModified();		fileDate = DateFormat.getDateInstance().format(new Date(lastModified));		InputStream imageInputStream = null;		InputStream thumbInputStream = null;		if (!isRepresentsSubdirectory)		{			try			{				// get image size using ImageInfo class				imageInputStream = imageAccessor.getImageInputStream();				ImageInfo ii = new ImageInfo();				ii.setInput(imageInputStream);				if (!ii.check())				{					throw new GalleryException(							"Not a supported image file format.");				}				imageWidth = Integer.toString(ii.getWidth());				imageHeight = Integer.toString(ii.getHeight());				fileSize = Long.toString(imageAccessor.getLength());				//              get thumbnail image size using ImageInfo class				thumbInputStream = imageAccessor.getThumbInputStream();				ii = new ImageInfo();				ii.setInput(thumbInputStream);				if (!ii.check())				{					throw new GalleryException(							"Not a supported image file format.");				}				thumbWidth = Integer.toString(ii.getWidth());				thumbHeight = Integer.toString(ii.getHeight());			}			catch (FileNotFoundException e)			{				throw new GalleryException(e.getMessage());			}			finally			{				if (imageInputStream != null)				{					try					{						imageInputStream.close();					}					catch (IOException e)					{						// NOP					}				}				if (thumbInputStream != null)				{					try					{						thumbInputStream.close();					}					catch (IOException e)					{						// NOP											}				}			}			try			{				imageInputStream = imageAccessor.getImageInputStream();			}			catch (FileNotFoundException e)			{				throw new GalleryException(e.getMessage());			}			try			{				exif = new EXIFInfo(imageInputStream);			}			catch (GalleryException e1)			{				exif = null;			}		}	}