public void startDownload() {
		File path = new File(dir);
		if (!path.exists())
			path.mkdirs();
		String fileFormat = format == FORMAT_JPG ? "jpg" : remoteurl
				.substring(remoteurl.lastIndexOf(".") + 1);
		File file = new File(dir + filename + "." + fileFormat);
		if (!(file.exists() && file.length() > 0)) {
			// create file
			try {
				file.createNewFile();
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			// download image file
			BufferedImage image = WebClient.readImage(remoteurl);
			try {
				ImageIO.write(image, fileFormat, file);
			} catch (IOException e) {
				System.out.println(e.getMessage());
			}
		}
	}