Commits

P_W999 committed 7ae3b59

- Eclipse clean-up

  • Participants
  • Parent commits b87fa3c

Comments (0)

Files changed (19)

File src/be/pw/jexif/DemoApp.java

 		File tmp = File.createTempFile("jexiftool", ".jpg");
 		tmp.deleteOnExit();
 		Files.copy(new File("test-resources/read04.JPG"), tmp);
-		
+
 		// tool.stop();
 		JExifInfo write1 = tool.getInfo(tmp);
 		LOG.info("ISO value is for read 1 = {}", info1.getTag(ExifIFD.ISO));
 		LOG.info("FOCAL_LENGTH exact value is for read 4 = {}", info4.getExactTag(ExifIFD.FOCALLENGTH));
 		LOG.info("FOCAL_LENGTH exact value is for read 3 = {}", info3.getExactTag(ExifIFD.FOCALLENGTH));
 
-		
 		LOG.info("FOCAL_LENGTH value is for read 4 = {}", info4.getTag(ExifIFD.FOCALLENGTH));
 		LOG.info("Writing 5 to FOCAL_LENGTH for write 1 -> {}", write1.setTag(ExifIFD.FOCALLENGTH, "5.0"));
 		LOG.info("FOCAL_LENGTH value is for write 1 = {}", write1.getTag(ExifIFD.FOCALLENGTH));

File src/be/pw/jexif/JExifInfo.java

 
 import java.io.File;
 
-import com.google.common.annotations.Beta;
-
 import be.pw.jexif.enums.tag.Tag;
 import be.pw.jexif.exception.ExifError;
 import be.pw.jexif.exception.JExifException;
 
+import com.google.common.annotations.Beta;
+
 /**
  * The JExifInfo class can be used to read or write a Tag from and to a given file.<br />
  * Reading tags involves lazy-loading, this means that tag information will only be read when asked for.
 	 * @param tag the tag to write to.
 	 * @param value the value to write.
 	 * @return the result.
-	 * @throws JExifException 
-	 * @throws ExifError 
+	 * @throws JExifException
+	 * @throws ExifError
 	 */
 	@Beta
 	public String setTag(final Tag tag, final String value) throws ExifError, JExifException {

File src/be/pw/jexif/JExifTool.java

  ******************************************************************************/
 package be.pw.jexif;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.enums.tag.Tag;
 import be.pw.jexif.exception.ExifError;
 import com.google.common.annotations.Beta;
 import com.google.common.base.Preconditions;
 import com.google.common.eventbus.EventBus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.*;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 /**
  * JExifTool is the main class to use. <br />
  * This class is responsible for starting and stopping ExifTool.
- *
  * @author phillip
  */
 @Beta
 public class JExifTool {
-    /**
-     * The argsFile is a file on the disk where the command line arguments are stored for ExifTool in -stay_open mode. The path to this file will be passed as the -@ argument.
-     */
-    private final File argsFile = new File("args");
-    /**
-     * The writer for {@link be.pw.jexif.JExifTool#argsFile}
-     */
-    private FileWriter argsWriter = null;
-    /**
-     * The path to the ExifTool executable. If the system property was not defined, the application will back to the current directory and expects the executable to be called "exiftool.exe". <br />
-     *
-     * @see be.pw.jexif.internal.constants.ExecutionConstant#EXIFTOOLPATH
-     */
-    private final File exifToolPath = new File(System.getProperty(ExecutionConstant.EXIFTOOLPATH, ".\\exiftool.exe"));
-    /**
-     * Timeout in milliseconds before the application decides that the for-looping which is waiting for the ExifTool output has deadlocked.<br />
-     * This might happen if all of a sudden ExifTool crashes or is not up and running.
-     *
-     * @see be.pw.jexif.internal.constants.ExecutionConstant#EXIFTOOLDEADLOCK
-     */
-    private final int deadLock = Integer.getInteger(ExecutionConstant.EXIFTOOLDEADLOCK, 2000);
-    /**
-     * This will hold a reference to the ExifTool.exe process.
-     */
-    private Process p;
-    /**
-     * The guava EventBuss will be used to handle the output- and error-streams from the ExifTool process.
-     */
-    private EventBus bus = new EventBus();
+	/**
+	 * The argsFile is a file on the disk where the command line arguments are stored for ExifTool in -stay_open mode. The path to this file will be passed as the -@ argument.
+	 */
+	private final File argsFile = new File("args");
+	/**
+	 * The writer for {@link be.pw.jexif.JExifTool#argsFile}
+	 */
+	private FileWriter argsWriter = null;
+	/**
+	 * The path to the ExifTool executable. If the system property was not defined, the application will back to the current directory and expects the executable to be called "exiftool.exe". <br />
+	 * @see be.pw.jexif.internal.constants.ExecutionConstant#EXIFTOOLPATH
+	 */
+	private final File exifToolPath = new File(System.getProperty(ExecutionConstant.EXIFTOOLPATH, ".\\exiftool.exe"));
+	/**
+	 * Timeout in milliseconds before the application decides that the for-looping which is waiting for the ExifTool output has deadlocked.<br />
+	 * This might happen if all of a sudden ExifTool crashes or is not up and running.
+	 * @see be.pw.jexif.internal.constants.ExecutionConstant#EXIFTOOLDEADLOCK
+	 */
+	private final int deadLock = Integer.getInteger(ExecutionConstant.EXIFTOOLDEADLOCK, 2000);
+	/**
+	 * This will hold a reference to the ExifTool.exe process.
+	 */
+	private Process p;
+	/**
+	 * The guava EventBuss will be used to handle the output- and error-streams from the ExifTool process.
+	 */
+	private EventBus bus = new EventBus();
 
-    /**
-     * The logger for this class.
-     */
-    private static final Logger LOG = LoggerFactory.getLogger(JExifTool.class);
-    /**
-     * The thread which will handle the output from the ExifTool process.
-     */
-    private Thread inputReaderThread;
-    /**
-     * The thread which will handle the error output from the ExifTool process.
-     */
-    private Thread errorReaderThread;
-    /**
-     * The "master" thread which is responsible for the ExifTool process and the two sub-threads for handling the output.
-     */
-    private Thread exifThread;
+	/**
+	 * The logger for this class.
+	 */
+	private static final Logger LOG = LoggerFactory.getLogger(JExifTool.class);
+	/**
+	 * The thread which will handle the output from the ExifTool process.
+	 */
+	private Thread inputReaderThread;
+	/**
+	 * The thread which will handle the error output from the ExifTool process.
+	 */
+	private Thread errorReaderThread;
+	/**
+	 * The "master" thread which is responsible for the ExifTool process and the two sub-threads for handling the output.
+	 */
+	private Thread exifThread;
 
-    /**
-     * Default constructor. <br />
-     * This automatically starts the ExifTool process.
-     */
-    @Beta
-    public JExifTool() {
-        this.start();
-    }
+	/**
+	 * Default constructor. <br />
+	 * This automatically starts the ExifTool process.
+	 */
+	@Beta
+	public JExifTool() {
+		this.start();
+	}
 
-    /**
-     * Creates a new instance of a JExifInfo object.
-     *
-     * @param file the image file from which tags shall be read from or written to.
-     * @return a JExifInfo object.
-     */
-    @Beta
-    public JExifInfo getInfo(final File file) {
-        Preconditions.checkNotNull(file);
-        return new JExifInfo(this, file);
-    }
+	/**
+	 * Creates a new instance of a JExifInfo object.
+	 * @param file the image file from which tags shall be read from or written to.
+	 * @return a JExifInfo object.
+	 */
+	@Beta
+	public JExifInfo getInfo(final File file) {
+		Preconditions.checkNotNull(file);
+		return new JExifInfo(this, file);
+	}
 
-    /**
-     * Starts the ExifTool process and several subthreads to handle the streams.<br />
-     * This method is automatically called when a new instance of JExifTool is created.
-     */
-    private synchronized final void start() {
-        LOG.trace("Using exifToolPath in: " + exifToolPath.getAbsolutePath());
-        LOG.trace("Argsfile is stored in: " + argsFile.getAbsolutePath());
-        try {
-            argsWriter = new FileWriter(argsFile);
-            argsWriter.write("");
-            argsWriter.flush();
-            exifThread = new Thread(new Runnable() {
-                @Override
-                public synchronized void run() {
-                    try {
-                        String claFormat;
-                        String cla;
-                        if (System.getProperty("os.name").toLowerCase().contains("windows")) {
-                            LOG.trace("Running windows: always putting CLA between \" \"");
-                            claFormat = ExecutionConstant.WINDOWS_CLA;
-                        } else {
-                            if (argsFile.getCanonicalPath().contains(" ")) {
-                                claFormat = ExecutionConstant.MAC_CLA;
-                            } else {
-                                claFormat = ExecutionConstant.LINUX_CLA;
-                            }
-                        }
-                        cla = MessageFormat.format(claFormat, exifToolPath.getCanonicalPath(), argsFile.getCanonicalPath());
-                        LOG.trace("Starting ExifTool with command line arguments {}", cla);
-                        p = Runtime.getRuntime().exec(cla);
-                        BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream()));
-                        BufferedReader bre = new BufferedReader(new InputStreamReader(p.getErrorStream()));
-                        DebugHandler debug = new DebugHandler();
-                        bus.register(debug);
-                        inputReaderThread = new Thread(new RunnableReader(bri, bus, false));
-                        inputReaderThread.setName("inputReaderThread");
-                        inputReaderThread.start();
-                        errorReaderThread = new Thread(new RunnableReader(bre, bus, true));
-                        errorReaderThread.setName("errorReaderThread");
-                        errorReaderThread.start();
-                        notify();
-                        LOG.trace("Left the monitor");
-                    } catch (Exception e) {
-                        LOG.error(Cal10nUtil.get(Errors.EXIFTHREAD), e);
-                    }
-                }
-            });
+	/**
+	 * Starts the ExifTool process and several subthreads to handle the streams.<br />
+	 * This method is automatically called when a new instance of JExifTool is created.
+	 */
+	private synchronized final void start() {
+		LOG.trace("Using exifToolPath in: " + exifToolPath.getAbsolutePath());
+		LOG.trace("Argsfile is stored in: " + argsFile.getAbsolutePath());
+		try {
+			argsWriter = new FileWriter(argsFile);
+			argsWriter.write("");
+			argsWriter.flush();
+			exifThread = new Thread(new Runnable() {
+				@Override
+				public synchronized void run() {
+					try {
+						String claFormat;
+						String cla;
+						if (System.getProperty("os.name").toLowerCase().contains("windows")) {
+							LOG.trace("Running windows: always putting CLA between \" \"");
+							claFormat = ExecutionConstant.WINDOWS_CLA;
+						} else {
+							if (argsFile.getCanonicalPath().contains(" ")) {
+								claFormat = ExecutionConstant.MAC_CLA;
+							} else {
+								claFormat = ExecutionConstant.LINUX_CLA;
+							}
+						}
+						cla = MessageFormat.format(claFormat, exifToolPath.getCanonicalPath(), argsFile.getCanonicalPath());
+						LOG.trace("Starting ExifTool with command line arguments {}", cla);
+						p = Runtime.getRuntime().exec(cla);
+						BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream()));
+						BufferedReader bre = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+						DebugHandler debug = new DebugHandler();
+						bus.register(debug);
+						inputReaderThread = new Thread(new RunnableReader(bri, bus, false));
+						inputReaderThread.setName("inputReaderThread");
+						inputReaderThread.start();
+						errorReaderThread = new Thread(new RunnableReader(bre, bus, true));
+						errorReaderThread.setName("errorReaderThread");
+						errorReaderThread.start();
+						notify();
+						LOG.trace("Left the monitor");
+					} catch (Exception e) {
+						LOG.error(Cal10nUtil.get(Errors.EXIFTHREAD), e);
+					}
+				}
+			});
 
-            synchronized (exifThread) {
-                exifThread.setName("ExifTool-thread");
-                exifThread.start();
-                exifThread.wait();    //wait unconditionally for the notify, we must be sure all the threads are running.
-            }
-            LOG.debug("ExifTool-thread and subthreads started");
-        } catch (IOException e) {
-            LOG.error(Cal10nUtil.get(Errors.IO_ARGSFILE), e);
-        } catch (InterruptedException e) {
-            LOG.error("Failed to join exifThread", e);
-        }
-    }
+			synchronized (exifThread) {
+				exifThread.setName("ExifTool-thread");
+				exifThread.start();
+				exifThread.wait(); // wait unconditionally for the notify, we must be sure all the threads are running.
+			}
+			LOG.debug("ExifTool-thread and subthreads started");
+		} catch (IOException e) {
+			LOG.error(Cal10nUtil.get(Errors.IO_ARGSFILE), e);
+		} catch (InterruptedException e) {
+			LOG.error("Failed to join exifThread", e);
+		}
+	}
 
-    /**
-     * Starts the ExifTool process if needed (if eg. it auto-closed itself after 10 minutes).
-     */
-    private synchronized void startIfNecessary() {
-        if (p != null) {
-            try {
-                p.exitValue();
-            } catch (IllegalThreadStateException e) {
-                LOG.debug("ExifTool process was still running");
-                return;
-            }
-        }
-        LOG.info("ExifTool process was not running, re-starting it");
-        inputReaderThread.interrupt();
-        errorReaderThread.interrupt();
-        start();
-    }
+	/**
+	 * Starts the ExifTool process if needed (if eg. it auto-closed itself after 10 minutes).
+	 */
+	private synchronized void startIfNecessary() {
+		if (p != null) {
+			try {
+				p.exitValue();
+			} catch (IllegalThreadStateException e) {
+				LOG.debug("ExifTool process was still running");
+				return;
+			}
+		}
+		LOG.info("ExifTool process was not running, re-starting it");
+		inputReaderThread.interrupt();
+		errorReaderThread.interrupt();
+		start();
+	}
 
-    /**
-     * Stops the ExifTool-thread.
-     *
-     * @throws JExifException if it failed to stop (there is a Thread.sleep which may throw an InterruptedException).
-     */
-    @Beta
-    public void stop() throws JExifException {
-        try {
-            LOG.trace("Stopping ExifTool process");
-            argsWriter.append(ExecutionConstant.STAY_OPEN).append("\r\n");
-            argsWriter.append("false\n");
-            argsWriter.flush();
-            boolean stopped = false;
-            while (!stopped) {
-                try {
-                    p.exitValue();
-                    stopped = true;
-                } catch (IllegalThreadStateException e) {
-                    stopped = false;
-                    try {
-                        Thread.sleep(10);
-                    } catch (InterruptedException e1) {
-                        LOG.error("An error occured while sleeping while stopping ExifTool process", e);
-                        throw new JExifException(e1);
-                    }
-                }
-            }
-            LOG.debug("ExifTool process should have stopped");
-        } catch (IOException e) {
-            LOG.error(Cal10nUtil.get(Errors.IO_CLOSING), e);
-        }
-    }
+	/**
+	 * Stops the ExifTool-thread.
+	 * @throws JExifException if it failed to stop (there is a Thread.sleep which may throw an InterruptedException).
+	 */
+	@Beta
+	public void stop() throws JExifException {
+		try {
+			LOG.trace("Stopping ExifTool process");
+			argsWriter.append(ExecutionConstant.STAY_OPEN).append("\r\n");
+			argsWriter.append("false\n");
+			argsWriter.flush();
+			boolean stopped = false;
+			while (!stopped) {
+				try {
+					p.exitValue();
+					stopped = true;
+				} catch (IllegalThreadStateException e) {
+					stopped = false;
+					try {
+						Thread.sleep(10);
+					} catch (InterruptedException e1) {
+						LOG.error("An error occured while sleeping while stopping ExifTool process", e);
+						throw new JExifException(e1);
+					}
+				}
+			}
+			LOG.debug("ExifTool process should have stopped");
+		} catch (IOException e) {
+			LOG.error(Cal10nUtil.get(Errors.IO_CLOSING), e);
+		}
+	}
 
-    /**
-     * This method will read out the specified tag from the given file. Default to using the non-exact format.
-     *
-     * @param file the file from which to read.
-     * @param tag  the tag to read out.
-     * @return the tag value as String or null if nothing found.
-     * @throws JExifException when writing the argsfile went wrong or when the Tread.sleep caused problems.
-     * @throws ExifError      if there was a problem in ExifTool
-     */
-    String readTagInfo(final File file, final Tag tag) throws JExifException, ExifError {
-        return readTagInfo(file, tag, false);
-    }
+	/**
+	 * This method will read out the specified tag from the given file. Default to using the non-exact format.
+	 * @param file the file from which to read.
+	 * @param tag the tag to read out.
+	 * @return the tag value as String or null if nothing found.
+	 * @throws JExifException when writing the argsfile went wrong or when the Tread.sleep caused problems.
+	 * @throws ExifError if there was a problem in ExifTool
+	 */
+	String readTagInfo(final File file, final Tag tag) throws JExifException, ExifError {
+		return readTagInfo(file, tag, false);
+	}
 
-    /**
-     * This method will read out the specified tag from the given file. Default to using the non-exact format.
-     *
-     * @param file the file from which to read.
-     * @param tag  the tag to read out.
-     * @return the tag value as String or null if nothing found.
-     * @throws JExifException when writing the argsfile went wrong or when the Tread.sleep caused problems (or the execution took to long).
-     * @throws ExifError      if there was a problem in ExifTool
-     */
-    String readTagInfo(final File file, final Tag tag, final boolean exact) throws JExifException, ExifError {
-        startIfNecessary();
-        int i = 0;
-        IAction action;
-        EventHandler handler;
-        try {
-            LOG.trace("Starting readTagInfo");
-            if (exact) {
-                action = ActionFactory.createExactReadAction(file, tag);
-            } else {
-                action = ActionFactory.createReadAction(file, tag);
-            }
-            String[] arguments = action.buildArguments();
-            for (String argument : arguments) {
-                argsWriter.append(argument).append("\r\n");
-            }
-            handler = new EventHandler();
-            bus.register(handler);
-            LOG.trace("Registered the EventHandler");
-            argsWriter.flush();
-            while (!handler.isFinished() && i <= deadLock) {
-                Thread.sleep(50);
-                i += 50;
-            }
-            if (!handler.isFinished()) {
-                LOG.error(Cal10nUtil.get(Errors.DEADLOCK, i));
-                throw new JExifException(Cal10nUtil.get(Errors.DEADLOCK, i));
-            }
-            bus.unregister(handler);
-        } catch (IOException e) {
-            LOG.error(Cal10nUtil.get(Errors.IO_ARGSFILE), e);
-            throw new JExifException(e);
-        } catch (InterruptedException e) {
-            LOG.error(Cal10nUtil.get(Errors.INTERRUPTED_SLEEP), e);
-            throw new JExifException(e);
-        }
-        LOG.trace("Handler finished");
-        List<String> results = handler.getResultList();
-        List<String> errors = handler.getErrorList();
-        LOG.trace("Parsing results");
-        ResultHandler.run(action, results, errors);
-        return action.getResult().get(tag);
-    }
+	/**
+	 * This method will read out the specified tag from the given file. Default to using the non-exact format.
+	 * @param file the file from which to read.
+	 * @param tag the tag to read out.
+	 * @return the tag value as String or null if nothing found.
+	 * @throws JExifException when writing the argsfile went wrong or when the Tread.sleep caused problems (or the execution took to long).
+	 * @throws ExifError if there was a problem in ExifTool
+	 */
+	String readTagInfo(final File file, final Tag tag, final boolean exact) throws JExifException, ExifError {
+		startIfNecessary();
+		int i = 0;
+		IAction action;
+		EventHandler handler;
+		try {
+			LOG.trace("Starting readTagInfo");
+			if (exact) {
+				action = ActionFactory.createExactReadAction(file, tag);
+			} else {
+				action = ActionFactory.createReadAction(file, tag);
+			}
+			String[] arguments = action.buildArguments();
+			for (String argument : arguments) {
+				argsWriter.append(argument).append("\r\n");
+			}
+			handler = new EventHandler();
+			bus.register(handler);
+			LOG.trace("Registered the EventHandler");
+			argsWriter.flush();
+			while (!handler.isFinished() && i <= deadLock) {
+				Thread.sleep(50);
+				i += 50;
+			}
+			if (!handler.isFinished()) {
+				LOG.error(Cal10nUtil.get(Errors.DEADLOCK, i));
+				throw new JExifException(Cal10nUtil.get(Errors.DEADLOCK, i));
+			}
+			bus.unregister(handler);
+		} catch (IOException e) {
+			LOG.error(Cal10nUtil.get(Errors.IO_ARGSFILE), e);
+			throw new JExifException(e);
+		} catch (InterruptedException e) {
+			LOG.error(Cal10nUtil.get(Errors.INTERRUPTED_SLEEP), e);
+			throw new JExifException(e);
+		}
+		LOG.trace("Handler finished");
+		List<String> results = handler.getResultList();
+		List<String> errors = handler.getErrorList();
+		LOG.trace("Parsing results");
+		ResultHandler.run(action, results, errors);
+		return action.getResult().get(tag);
+	}
 
-    boolean writeTagInfo(File file, Tag tag, String value) throws ExifError, JExifException {
-        if (value == null || value.isEmpty()) {
-            return clearTagInfo(file, tag);
-        }
-        startIfNecessary();
-        int i = 0;
-        IAction action;
-        EventHandler handler;
-        try {
-            LOG.trace("Starting readTagInfo");
-            Map<Tag, String> valuesToWrite = new HashMap<>(1);
-            valuesToWrite.put(tag, value);
-            action = ActionFactory.createTagWriteAction(file, valuesToWrite);
-            String[] arguments = action.buildArguments();
-            for (String argument : arguments) {
-                argsWriter.append(argument).append("\r\n");
-            }
-            handler = new EventHandler();
-            bus.register(handler);
-            LOG.trace("Registered the EventHandler");
-            argsWriter.flush();
-            while (!handler.isFinished() && i <= deadLock) {
-                Thread.sleep(50);
-                i += 50;
-            }
-            if (!handler.isFinished()) {
-                LOG.error(Cal10nUtil.get(Errors.DEADLOCK, i));
-                throw new JExifException(Cal10nUtil.get(Errors.DEADLOCK, i));
-            }
-            bus.unregister(handler);
-        } catch (IOException e) {
-            LOG.error(Cal10nUtil.get(Errors.IO_ARGSFILE), e);
-            throw new JExifException(e);
-        } catch (InterruptedException e) {
-            LOG.error(Cal10nUtil.get(Errors.INTERRUPTED_SLEEP), e);
-            throw new JExifException(e);
-        }
-        LOG.trace("Handler finished");
-        List<String> results = handler.getResultList();
-        List<String> errors = handler.getErrorList();
-        LOG.trace("Parsing results");
-        ResultHandler.run(action, results, errors);
-        return true;
-    }
+	boolean writeTagInfo(final File file, final Tag tag, final String value) throws ExifError, JExifException {
+		if (value == null || value.isEmpty()) {
+			return clearTagInfo(file, tag);
+		}
+		startIfNecessary();
+		int i = 0;
+		IAction action;
+		EventHandler handler;
+		try {
+			LOG.trace("Starting readTagInfo");
+			Map<Tag, String> valuesToWrite = new HashMap<>(1);
+			valuesToWrite.put(tag, value);
+			action = ActionFactory.createTagWriteAction(file, valuesToWrite);
+			String[] arguments = action.buildArguments();
+			for (String argument : arguments) {
+				argsWriter.append(argument).append("\r\n");
+			}
+			handler = new EventHandler();
+			bus.register(handler);
+			LOG.trace("Registered the EventHandler");
+			argsWriter.flush();
+			while (!handler.isFinished() && i <= deadLock) {
+				Thread.sleep(50);
+				i += 50;
+			}
+			if (!handler.isFinished()) {
+				LOG.error(Cal10nUtil.get(Errors.DEADLOCK, i));
+				throw new JExifException(Cal10nUtil.get(Errors.DEADLOCK, i));
+			}
+			bus.unregister(handler);
+		} catch (IOException e) {
+			LOG.error(Cal10nUtil.get(Errors.IO_ARGSFILE), e);
+			throw new JExifException(e);
+		} catch (InterruptedException e) {
+			LOG.error(Cal10nUtil.get(Errors.INTERRUPTED_SLEEP), e);
+			throw new JExifException(e);
+		}
+		LOG.trace("Handler finished");
+		List<String> results = handler.getResultList();
+		List<String> errors = handler.getErrorList();
+		LOG.trace("Parsing results");
+		ResultHandler.run(action, results, errors);
+		return true;
+	}
 
-    boolean clearTagInfo(File file, Tag tag) {
-        startIfNecessary();
-        return false;
-    }
+	boolean clearTagInfo(final File file, final Tag tag) {
+		startIfNecessary();
+		return false;
+	}
 
 }

File src/be/pw/jexif/enums/DataType.java

 package be.pw.jexif.enums;
+
 /**
- * Since tags can be either signed or unsigned, we need to find a way to make a difference between eg int32u and int32s. 
+ * Since tags can be either signed or unsigned, we need to find a way to make a difference between eg int32u and int32s.
  * @author phillip
- *
  */
 public enum DataType {
 

File src/be/pw/jexif/enums/Errors.java

  * Enum which is used in combination with cal10n to i18n the errormessages.
  */
 @BaseName("errorMessages")
-@LocaleData({@Locale("en")})
+@LocaleData({ @Locale("en") })
 public enum Errors {
-    GENERAL, EXIFTHREAD, IO_ARGSFILE, IO_CLOSING, INTERRUPTED_SLEEP, DEADLOCK, VALIDATION_TAGLIST,
-    IO_BUILD_ARGUMENTS, VALIDATION_VALUESLIST, EXIFTOOL_EXECUTION_ERROR, EXIFTOOL_EXECUTION_WARNING,
-    RETREIVE_PARSER_ERROR, PARSER_UNKNOWNTYPE, PARSER_MISMATCH, VALIDATION_WRITE_PROTECTED_TAG, VALIDATION_WRITE_AVOIDED_TAG,
-    VALIDATION_WRITE_UNSAFE_TAG, UNKNOWN_DATATYPE, VALIDATION_NEGATIVE_UNSIGNED, VALIDATION_EXCEEDS_LIMITS, VALIDATION_RAT_FOR_INT, 
-    VALIDATION_INVALID_TYPE;
+	GENERAL, EXIFTHREAD, IO_ARGSFILE, IO_CLOSING, INTERRUPTED_SLEEP, DEADLOCK, VALIDATION_TAGLIST, IO_BUILD_ARGUMENTS, VALIDATION_VALUESLIST, EXIFTOOL_EXECUTION_ERROR, EXIFTOOL_EXECUTION_WARNING, RETREIVE_PARSER_ERROR, PARSER_UNKNOWNTYPE, PARSER_MISMATCH, VALIDATION_WRITE_PROTECTED_TAG, VALIDATION_WRITE_AVOIDED_TAG, VALIDATION_WRITE_UNSAFE_TAG, UNKNOWN_DATATYPE, VALIDATION_NEGATIVE_UNSIGNED, VALIDATION_EXCEEDS_LIMITS, VALIDATION_RAT_FOR_INT, VALIDATION_INVALID_TYPE;
 }

File src/be/pw/jexif/enums/tag/ExifIFD.java

 import static be.pw.jexif.enums.DataType.RAT64U;
 import static be.pw.jexif.enums.DataType.STRING;
 import static be.pw.jexif.enums.DataType.UNDEF;
-
-import java.util.HashMap;
-import java.util.Map;
-
 import be.pw.jexif.enums.DataType;
 
 public enum ExifIFD implements Tag {
 
-	APERTUREVALUE("ApertureValue",false,false,false,RAT64U),
-	APPLICATIONNOTES("ApplicationNotes",true,false,false,INT8U),
-	BRIGHTNESS("Brightness",false,true,false,STRING),
-	BRIGHTNESSVALUE("BrightnessValue",false,false,false,RAT64S),
-	CFAPATTERN("CFAPattern",false,false,false,UNDEF),
-	COLORSPACE("ColorSpace",false,false,false,INT16U),
-	COMPONENTSCONFIGURATION("ComponentsConfiguration",true,false,false,UNDEF),
-	COMPRESSEDBITSPERPIXEL("CompressedBitsPerPixel",true,false,false,RAT64U),
-	CONTRAST("Contrast",false,false,false,INT16U),
-	CONVERTER("Converter",false,true,false,STRING),
-	CREATEDATE("CreateDate",false,false,false,STRING),
-	CUSTOMRENDERED("CustomRendered",false,false,false,INT16U),
-	DATETIMEORIGINAL("DateTimeOriginal",false,false,false,STRING),
-	DIGITALZOOMRATIO("DigitalZoomRatio",false,false,false,RAT64U),
-	EXIFIMAGEHEIGHT("ExifImageHeight",false,false,false,INT16U),
-	EXIFIMAGEWIDTH("ExifImageWidth",false,false,false,INT16U),
-	EXIFVERSION("ExifVersion",false,false,false,UNDEF),
-	EXPOSURE("Exposure",false,true,false,STRING),
-	EXPOSURECOMPENSATION("ExposureCompensation",false,false,false,RAT64S),
-	EXPOSUREINDEX("ExposureIndex",false,false,false,RAT64U),
-	EXPOSUREMODE("ExposureMode",false,false,false,INT16U),
-	EXPOSUREPROGRAM("ExposureProgram",false,false,false,INT16U),
-	EXPOSURETIME("ExposureTime",false,false,false,RAT64U),
-	FILESOURCE("FileSource",false,false,false,UNDEF),
-	FLASH("Flash",false,false,false,INT16U),
-	FLASHENERGY("FlashEnergy",false,false,false,RAT64U),
-	FLASHPIXVERSION("FlashpixVersion",false,false,false,UNDEF),
-	FNUMBER("FNumber",false,false,false,RAT64U),
-	FOCALLENGTH("FocalLength",false,false,false,RAT64U),
-	FOCALLENGTHIN35MMFORMAT("FocalLengthIn35mmFormat",false,false,false,INT16U),
-	FOCALPLANERESOLUTIONUNIT("FocalPlaneResolutionUnit",false,false,false,INT16U),
-	FOCALPLANEXRESOLUTION("FocalPlaneXResolution",false,false,false,RAT64U),
-	FOCALPLANEYRESOLUTION("FocalPlaneYResolution",false,false,false,RAT64U),
-	GAINCONTROL("GainControl",false,false,false,INT16U),
-	GAMMA("Gamma",false,false,false,RAT64U),
-	IMAGEHISTORY("ImageHistory",false,false,false,STRING),
-	IMAGENUMBER("ImageNumber",false,false,false,INT32U),
-	IMAGEUNIQUEID("ImageUniqueID",false,false,false,STRING),
-	ISO("ISO",false,false,false,INT16U),
-	ISOSPEED("ISOSpeed",false,false,false,INT32U),
-	ISOSPEEDLATITUDEYYY("ISOSpeedLatitudeyyy",false,false,false,INT32U),
-	ISOSPEEDLATITUDEZZZ("ISOSpeedLatitudezzz",false,false,false,INT32U),
-	LENS("Lens",false,true,false,STRING),
-	LENSINFO("LensInfo",false,false,false,RAT64U),
-	LENSMAKE("LensMake",false,false,false,STRING),
-	LENSMODEL("LensModel",false,false,false,STRING),
-	LENSSERIALNUMBER("LensSerialNumber",false,false,false,STRING),
-	LIGHTSOURCE("LightSource",false,false,false,INT16U),
-	MAXAPERTUREVALUE("MaxApertureValue",false,false,false,RAT64U),
-	METERINGMODE("MeteringMode",false,false,false,INT16U),
-	MOIREFILTER("MoireFilter",false,true,false,STRING),
-	OFFSETSCHEMA("OffsetSchema",false,false,false,INT32S),
-	OWNERNAME("OwnerName",false,false,false,STRING),
-	PADDING("Padding",false,false,false,UNDEF),
-	RAWFILE("RawFile",false,true,false,STRING),
-	RECOMMENDEDEXPOSUREINDEX("RecommendedExposureIndex",false,false,false,INT32U),
-	RELATEDSOUNDFILE("RelatedSoundFile",false,false,false,STRING),
-	SATURATION("Saturation",false,false,false,INT16U),
-	SCENECAPTURETYPE("SceneCaptureType",false,false,false,INT16U),
-	SCENETYPE("SceneType",false,false,false,UNDEF),
-	SECURITYCLASSIFICATION("SecurityClassification",false,false,false,STRING),
-	SELFTIMERMODE("SelfTimerMode",false,false,false,INT16U),
-	SENSINGMETHOD("SensingMethod",false,false,false,INT16U),
-	SENSITIVITYTYPE("SensitivityType",false,false,false,INT16U),
-	SERIALNUMBER("SerialNumber",false,false,false,STRING),
-	SHADOWS("Shadows",false,true,false,STRING),
-	SHARPNESS("Sharpness",false,false,false,INT16U),
-	SHUTTERSPEEDVALUE("ShutterSpeedValue",false,false,false,RAT64S),
-	SMOOTHNESS("Smoothness",false,true,false,STRING),
-	SPECTRALSENSITIVITY("SpectralSensitivity",false,false,false,STRING),
-	STANDARDOUTPUTSENSITIVITY("StandardOutputSensitivity",false,false,false,INT32U),
-	SUBJECTAREA("SubjectArea",false,false,false,INT16U),
-	SUBJECTDISTANCE("SubjectDistance",false,false,false,RAT64U),
-	SUBJECTDISTANCERANGE("SubjectDistanceRange",false,false,false,INT16U),
-	SUBJECTLOCATION("SubjectLocation",false,false,false,INT16U),
-	SUBSECTIME("SubSecTime",false,false,false,STRING),
-	SUBSECTIMEDIGITIZED("SubSecTimeDigitized",false,false,false,STRING),
-	SUBSECTIMEORIGINAL("SubSecTimeOriginal",false,false,false,STRING),
-	TIMEZONEOFFSET("TimeZoneOffset",false,false,false,INT16S),
-	USERCOMMENT("UserComment",false,false,false,UNDEF),
-	WHITEBALANCE("WhiteBalance",false,false,false,INT16U),
-	;
+	APERTUREVALUE("ApertureValue", false, false, false, RAT64U), APPLICATIONNOTES("ApplicationNotes", true, false, false, INT8U), BRIGHTNESS("Brightness", false, true, false, STRING), BRIGHTNESSVALUE("BrightnessValue", false, false, false, RAT64S), CFAPATTERN("CFAPattern", false, false, false, UNDEF), COLORSPACE("ColorSpace", false, false, false, INT16U), COMPONENTSCONFIGURATION("ComponentsConfiguration", true, false, false, UNDEF), COMPRESSEDBITSPERPIXEL("CompressedBitsPerPixel", true, false, false, RAT64U), CONTRAST("Contrast", false, false, false, INT16U), CONVERTER("Converter", false, true, false, STRING), CREATEDATE("CreateDate", false, false, false, STRING), CUSTOMRENDERED("CustomRendered", false, false, false, INT16U), DATETIMEORIGINAL("DateTimeOriginal", false, false, false, STRING), DIGITALZOOMRATIO("DigitalZoomRatio", false, false, false, RAT64U), EXIFIMAGEHEIGHT("ExifImageHeight", false, false, false, INT16U), EXIFIMAGEWIDTH("ExifImageWidth", false, false, false, INT16U), EXIFVERSION("ExifVersion", false, false, false, UNDEF), EXPOSURE("Exposure", false, true, false, STRING), EXPOSURECOMPENSATION("ExposureCompensation", false, false, false, RAT64S), EXPOSUREINDEX("ExposureIndex", false, false, false, RAT64U), EXPOSUREMODE("ExposureMode", false, false, false, INT16U), EXPOSUREPROGRAM("ExposureProgram", false, false, false, INT16U), EXPOSURETIME("ExposureTime", false, false, false, RAT64U), FILESOURCE("FileSource", false, false, false, UNDEF), FLASH("Flash", false, false, false, INT16U), FLASHENERGY("FlashEnergy", false, false, false, RAT64U), FLASHPIXVERSION("FlashpixVersion", false, false, false, UNDEF), FNUMBER("FNumber", false, false, false, RAT64U), FOCALLENGTH("FocalLength", false, false, false, RAT64U), FOCALLENGTHIN35MMFORMAT("FocalLengthIn35mmFormat", false, false, false, INT16U), FOCALPLANERESOLUTIONUNIT("FocalPlaneResolutionUnit", false, false, false, INT16U), FOCALPLANEXRESOLUTION("FocalPlaneXResolution", false, false, false, RAT64U), FOCALPLANEYRESOLUTION("FocalPlaneYResolution", false, false, false, RAT64U), GAINCONTROL("GainControl", false, false, false, INT16U), GAMMA("Gamma", false, false, false, RAT64U), IMAGEHISTORY("ImageHistory", false, false, false, STRING), IMAGENUMBER("ImageNumber", false, false, false, INT32U), IMAGEUNIQUEID("ImageUniqueID", false, false, false, STRING), ISO("ISO", false, false, false, INT16U), ISOSPEED("ISOSpeed", false, false, false, INT32U), ISOSPEEDLATITUDEYYY("ISOSpeedLatitudeyyy", false, false, false, INT32U), ISOSPEEDLATITUDEZZZ("ISOSpeedLatitudezzz", false, false, false, INT32U), LENS("Lens", false, true, false, STRING), LENSINFO("LensInfo", false, false, false, RAT64U), LENSMAKE("LensMake", false, false, false, STRING), LENSMODEL("LensModel", false, false, false, STRING), LENSSERIALNUMBER("LensSerialNumber", false, false, false, STRING), LIGHTSOURCE("LightSource", false, false, false, INT16U), MAXAPERTUREVALUE("MaxApertureValue", false, false, false, RAT64U), METERINGMODE("MeteringMode", false, false, false, INT16U), MOIREFILTER("MoireFilter", false, true, false, STRING), OFFSETSCHEMA("OffsetSchema", false, false, false, INT32S), OWNERNAME("OwnerName", false, false, false, STRING), PADDING("Padding", false, false, false, UNDEF), RAWFILE("RawFile", false, true, false, STRING), RECOMMENDEDEXPOSUREINDEX("RecommendedExposureIndex", false, false, false, INT32U), RELATEDSOUNDFILE("RelatedSoundFile", false, false, false, STRING), SATURATION("Saturation", false, false, false, INT16U), SCENECAPTURETYPE("SceneCaptureType", false, false, false, INT16U), SCENETYPE("SceneType", false, false, false, UNDEF), SECURITYCLASSIFICATION("SecurityClassification", false, false, false, STRING), SELFTIMERMODE("SelfTimerMode", false, false, false, INT16U), SENSINGMETHOD("SensingMethod", false, false, false, INT16U), SENSITIVITYTYPE("SensitivityType", false, false, false, INT16U), SERIALNUMBER("SerialNumber", false, false, false, STRING), SHADOWS("Shadows", false, true, false, STRING), SHARPNESS("Sharpness", false, false, false, INT16U), SHUTTERSPEEDVALUE("ShutterSpeedValue", false, false, false, RAT64S), SMOOTHNESS("Smoothness", false, true, false, STRING), SPECTRALSENSITIVITY("SpectralSensitivity", false, false, false, STRING), STANDARDOUTPUTSENSITIVITY("StandardOutputSensitivity", false, false, false, INT32U), SUBJECTAREA("SubjectArea", false, false, false, INT16U), SUBJECTDISTANCE("SubjectDistance", false, false, false, RAT64U), SUBJECTDISTANCERANGE("SubjectDistanceRange", false, false, false, INT16U), SUBJECTLOCATION("SubjectLocation", false, false, false, INT16U), SUBSECTIME("SubSecTime", false, false, false, STRING), SUBSECTIMEDIGITIZED("SubSecTimeDigitized", false, false, false, STRING), SUBSECTIMEORIGINAL("SubSecTimeOriginal", false, false, false, STRING), TIMEZONEOFFSET("TimeZoneOffset", false, false, false, INT16S), USERCOMMENT("UserComment", false, false, false, UNDEF), WHITEBALANCE("WhiteBalance", false, false, false, INT16U), ;
 
-	
 	private final boolean avoided;
 	private final boolean unsafe;
 	private final boolean protectedField;
 	private final String name;
-	private final DataType type; 
-	
-	
-
-	
+	private final DataType type;
 
 	/**
 	 * @param avoided
 	 * @param name
 	 * @param type
 	 */
-	private ExifIFD(String name, boolean unsafe, boolean avoided, boolean protectedField, DataType type) {
+	private ExifIFD(final String name, final boolean unsafe, final boolean avoided, final boolean protectedField, final DataType type) {
 		this.avoided = avoided;
 		this.unsafe = unsafe;
 		this.protectedField = protectedField;
 		this.type = type;
 	}
 
-
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#isAvoided()
 	 */
 	@Override
 		return avoided;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#isUnsafe()
 	 */
 	@Override
 		return unsafe;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#isProtectedField()
 	 */
 	@Override
 		return protectedField;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#getName()
 	 */
 	@Override
 		return name;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#getType()
 	 */
 	@Override
 	public final DataType getType() {
 		return type;
 	}
-	
-	
-	
+
 }

File src/be/pw/jexif/enums/tag/IFD0.java

 
 public enum IFD0 implements Tag {
 
-	ANALOGBALANCE("AnalogBalance",true,false,false,RAT64U),
-	ARTIST("Artist",false,false,false,STRING),
-	ASSHOTICCPROFILE("AsShotICCProfile",true,false,false,UNDEF),
-	ASSHOTNEUTRAL("AsShotNeutral",true,false,false,RAT64U),
-	ASSHOTPREPROFILEMATRIX("AsShotPreProfileMatrix",true,false,false,RAT64S),
-	ASSHOTPROFILENAME("AsShotProfileName",true,false,false,STRING),
-	ASSHOTWHITEXY("AsShotWhiteXY",true,false,false,RAT64U),
-	BASELINEEXPOSURE("BaselineExposure",true,false,false,RAT64S),
-	BASELINENOISE("BaselineNoise",true,false,false,RAT64U),
-	BASELINESHARPNESS("BaselineSharpness",true,false,false,RAT64U),
-	BITSPERSAMPLE("BitsPerSample",true,false,false,INT16U),
-	CALIBRATIONILLUMINANT1("CalibrationIlluminant1",true,false,false,INT16U),
-	CALIBRATIONILLUMINANT2("CalibrationIlluminant2",true,false,false,INT16U),
-	CAMERACALIBRATION1("CameraCalibration1",true,false,false,RAT64S),
-	CAMERACALIBRATION2("CameraCalibration2",true,false,false,RAT64S),
-	CAMERACALIBRATIONSIG("CameraCalibrationSig",true,false,false,STRING),
-	CAMERASERIALNUMBER("CameraSerialNumber",false,false,false,STRING),
-	CELLLENGTH("CellLength",true,false,false,INT16U),
-	CELLWIDTH("CellWidth",true,false,false,INT16U),
-	COLORIMETRICREFERENCE("ColorimetricReference",true,false,false,INT16U),
-	COLORMATRIX1("ColorMatrix1",true,false,false,RAT64S),
-	COLORMATRIX2("ColorMatrix2",true,false,false,RAT64S),
-	COMPRESSION("Compression",true,false,false,INT16U),
-	COPYRIGHT("Copyright",false,false,false,STRING),
-	CURRENTICCPROFILE("CurrentICCProfile",true,false,false,UNDEF),
-	CURRENTPREPROFILEMATRIX("CurrentPreProfileMatrix",true,false,false,RAT64S),
-	DNGBACKWARDVERSION("DNGBackwardVersion",true,false,false,INT8U),
-	DNGLENSINFO("DNGLensInfo",false,false,false,RAT64U),
-	DNGVERSION("DNGVersion",true,false,false,INT8U),
-	DOCUMENTNAME("DocumentName",false,false,false,STRING),
-	DOTRANGE("DotRange",false,false,false,STRING),
-	FILLORDER("FillOrder",true,false,false,INT16U),
-	FORWARDMATRIX1("ForwardMatrix1",true,false,false,RAT64S),
-	FORWARDMATRIX2("ForwardMatrix2",true,false,false,RAT64S),
-	GRAYRESPONSEUNIT("GrayResponseUnit",false,false,false,INT16U),
-	HALFTONEHINTS("HalftoneHints",false,false,false,INT16U),
-	HOSTCOMPUTER("HostComputer",false,false,false,STRING),
-	IMAGEDESCRIPTION("ImageDescription",false,false,false,STRING),
-	IMAGEHEIGHT("ImageHeight",true,false,false,INT32U),
-	IMAGESOURCEDATA("ImageSourceData",true,false,false,UNDEF),
-	IMAGEWIDTH("ImageWidth",true,false,false,INT32U),
-	INKSET("InkSet",false,false,false,INT16U),
-	IPTCNAA("IPTC-NAA",true,false,false,INT32U),
-	LINEARRESPONSELIMIT("LinearResponseLimit",true,false,false,RAT64U),
-	LOCALIZEDCAMERAMODEL("LocalizedCameraModel",false,false,false,STRING),
-	MAKE("Make",false,false,false,STRING),
-	MAKERNOTESAFETY("MakerNoteSafety",false,false,false,INT16U),
-	MAXSAMPLEVALUE("MaxSampleValue",false,false,false,INT16U),
-	MINSAMPLEVALUE("MinSampleValue",false,false,false,INT16U),
-	MODEL("Model",false,false,false,STRING),
-	MODIFYDATE("ModifyDate",false,false,false,STRING),
-	OLDSUBFILETYPE("OldSubfileType",true,false,false,INT16U),
-	ORIENTATION("Orientation",false,false,false,INT16U),
-	ORIGINALRAWFILEDATA("OriginalRawFileData",true,false,false,UNDEF),
-	ORIGINALRAWFILEDIGEST("OriginalRawFileDigest",true,false,false,INT8U),
-	ORIGINALRAWFILENAME("OriginalRawFileName",true,false,false,STRING),
-	PAGENAME("PageName",false,false,false,STRING),
-	PAGENUMBER("PageNumber",false,false,false,INT16U),
-	PANASONICTITLE("PanasonicTitle",false,false,false,UNDEF),
-	PANASONICTITLE2("PanasonicTitle2",false,false,false,UNDEF),
-	PHOTOMETRICINTERPRETATION("PhotometricInterpretation",true,false,false,INT16U),
-	PLANARCONFIGURATION("PlanarConfiguration",true,false,false,INT16U),
-	PREDICTOR("Predictor",true,false,false,INT16U),
-	PREVIEWAPPLICATIONNAME("PreviewApplicationName",true,false,false,STRING),
-	PREVIEWAPPLICATIONVERSION("PreviewApplicationVersion",true,false,false,STRING),
-	PREVIEWCOLORSPACE("PreviewColorSpace",true,false,false,INT32U),
-	PREVIEWDATETIME("PreviewDateTime",true,false,false,STRING),
-	PREVIEWSETTINGSDIGEST("PreviewSettingsDigest",true,false,false,INT8U),
-	PREVIEWSETTINGSNAME("PreviewSettingsName",true,false,false,STRING),
-	PRIMARYCHROMATICITIES("PrimaryChromaticities",false,false,false,RAT64U),
-	PRINTIM("PrintIM",false,false,false,UNDEF),
-	PROCESSINGSOFTWARE("ProcessingSoftware",false,false,false,STRING),
-	PROFILECALIBRATIONSIG("ProfileCalibrationSig",true,false,false,STRING),
-	PROFILECOPYRIGHT("ProfileCopyright",true,false,false,STRING),
-	PROFILEEMBEDPOLICY("ProfileEmbedPolicy",true,false,false,INT32U),
-	PROFILEHUESATMAPDATA1("ProfileHueSatMapData1",true,false,false,FLOAT),
-	PROFILEHUESATMAPDATA2("ProfileHueSatMapData2",true,false,false,FLOAT),
-	PROFILEHUESATMAPDIMS("ProfileHueSatMapDims",true,false,false,INT32U),
-	PROFILELOOKTABLEDATA("ProfileLookTableData",true,false,false,FLOAT),
-	PROFILELOOKTABLEDIMS("ProfileLookTableDims",true,false,false,INT32U),
-	PROFILENAME("ProfileName",true,false,false,STRING),
-	PROFILETONECURVE("ProfileToneCurve",true,false,false,FLOAT),
-	RATING("Rating",false,true,false,INT16U),
-	RATINGPERCENT("RatingPercent",false,true,false,INT16U),
-	RAWDATAUNIQUEID("RawDataUniqueID",true,false,false,INT8U),
-	RAWIMAGEDIGEST("RawImageDigest",true,false,false,INT8U),
-	REDUCTIONMATRIX1("ReductionMatrix1",true,false,false,RAT64S),
-	REDUCTIONMATRIX2("ReductionMatrix2",true,false,false,RAT64S),
-	REFERENCEBLACKWHITE("ReferenceBlackWhite",false,false,false,RAT64U),
-	RESOLUTIONUNIT("ResolutionUnit",false,false,false,INT16U),
-	ROWSPERSTRIP("RowsPerStrip",true,false,false,INT32U),
-	SAMPLESPERPIXEL("SamplesPerPixel",true,false,false,INT16U),
-	SEMINFO("SEMInfo",false,false,false,STRING),
-	SHADOWSCALE("ShadowScale",true,false,false,RAT64U),
-	SOFTWARE("Software",false,false,false,STRING),
-	SUBFILETYPE("SubfileType",true,false,false,INT32U),
-	THRESHOLDING("Thresholding",true,false,false,INT16U),
-	TILELENGTH("TileLength",true,false,false,INT32U),
-	TILEWIDTH("TileWidth",true,false,false,INT32U),
-	TRANSFERFUNCTION("TransferFunction",true,false,false,INT16U),
-	UNIQUECAMERAMODEL("UniqueCameraModel",false,false,false,STRING),
-	WHITEPOINT("WhitePoint",false,false,false,RAT64U),
-	XPAUTHOR("XPAuthor",false,false,false,INT8U),
-	XPCOMMENT("XPComment",false,false,false,INT8U),
-	XPKEYWORDS("XPKeywords",false,false,false,INT8U),
-	XPOSITION("XPosition",false,false,false,RAT64U),
-	XPSUBJECT("XPSubject",false,false,false,INT8U),
-	XPTITLE("XPTitle",false,false,false,INT8U),
-	XRESOLUTION("XResolution",false,false,false,RAT64U),
-	YCBCRCOEFFICIENTS("YCbCrCoefficients",true,false,false,RAT64U),
-	YCBCRPOSITIONING("YCbCrPositioning",true,false,false,INT16U),
-	YCBCRSUBSAMPLING("YCbCrSubSampling",true,false,false,INT16U),
-	YPOSITION("YPosition",false,false,false,RAT64U),
-	YRESOLUTION("YResolution",false,false,false,RAT64U),
-	INTEROPINDEX("InteropIndex",true,false,false,STRING),
-	INTEROPVERSION("InteropVersion",true,false,false,UNDEF),
-	RELATEDIMAGEFILEFORMAT("RelatedImageFileFormat",true,false,false,STRING),
-	RELATEDIMAGEHEIGHT("RelatedImageHeight",true,false,false,INT16U),
-	RELATEDIMAGEWIDTH("RelatedImageWidth",true,false,false,INT16U),
-	ACTIVEAREA("ActiveArea",true,false,false,INT32U),
-	ANTIALIASSTRENGTH("AntiAliasStrength",true,false,false,RAT64U),
-	BAYERGREENSPLIT("BayerGreenSplit",true,false,false,INT32U),
-	BESTQUALITYSCALE("BestQualityScale",true,false,false,RAT64U),
-	BLACKLEVEL("BlackLevel",true,false,false,RAT64U),
-	BLACKLEVELREPEATDIM("BlackLevelRepeatDim",true,false,false,INT16U),
-	CHROMABLURRADIUS("ChromaBlurRadius",true,false,false,RAT64U),
-	DEFAULTCROPORIGIN("DefaultCropOrigin",true,false,false,INT32U),
-	DEFAULTCROPSIZE("DefaultCropSize",true,false,false,INT32U),
-	DEFAULTSCALE("DefaultScale",true,false,false,RAT64U),
-	LINEARIZATIONTABLE("LinearizationTable",true,false,false,INT16U),
-	MASKEDAREAS("MaskedAreas",true,false,false,INT32U),
-	NOISEREDUCTIONAPPLIED("NoiseReductionApplied",true,false,false,RAT64U),
-	WHITELEVEL("WhiteLevel",true,false,false,INT32U);
-
-	
+	ANALOGBALANCE("AnalogBalance", true, false, false, RAT64U), ARTIST("Artist", false, false, false, STRING), ASSHOTICCPROFILE("AsShotICCProfile", true, false, false, UNDEF), ASSHOTNEUTRAL("AsShotNeutral", true, false, false, RAT64U), ASSHOTPREPROFILEMATRIX("AsShotPreProfileMatrix", true, false, false, RAT64S), ASSHOTPROFILENAME("AsShotProfileName", true, false, false, STRING), ASSHOTWHITEXY("AsShotWhiteXY", true, false, false, RAT64U), BASELINEEXPOSURE("BaselineExposure", true, false, false, RAT64S), BASELINENOISE("BaselineNoise", true, false, false, RAT64U), BASELINESHARPNESS("BaselineSharpness", true, false, false, RAT64U), BITSPERSAMPLE("BitsPerSample", true, false, false, INT16U), CALIBRATIONILLUMINANT1("CalibrationIlluminant1", true, false, false, INT16U), CALIBRATIONILLUMINANT2("CalibrationIlluminant2", true, false, false, INT16U), CAMERACALIBRATION1("CameraCalibration1", true, false, false, RAT64S), CAMERACALIBRATION2("CameraCalibration2", true, false, false, RAT64S), CAMERACALIBRATIONSIG("CameraCalibrationSig", true, false, false, STRING), CAMERASERIALNUMBER("CameraSerialNumber", false, false, false, STRING), CELLLENGTH("CellLength", true, false, false, INT16U), CELLWIDTH("CellWidth", true, false, false, INT16U), COLORIMETRICREFERENCE("ColorimetricReference", true, false, false, INT16U), COLORMATRIX1("ColorMatrix1", true, false, false, RAT64S), COLORMATRIX2("ColorMatrix2", true, false, false, RAT64S), COMPRESSION("Compression", true, false, false, INT16U), COPYRIGHT("Copyright", false, false, false, STRING), CURRENTICCPROFILE("CurrentICCProfile", true, false, false, UNDEF), CURRENTPREPROFILEMATRIX("CurrentPreProfileMatrix", true, false, false, RAT64S), DNGBACKWARDVERSION("DNGBackwardVersion", true, false, false, INT8U), DNGLENSINFO("DNGLensInfo", false, false, false, RAT64U), DNGVERSION("DNGVersion", true, false, false, INT8U), DOCUMENTNAME("DocumentName", false, false, false, STRING), DOTRANGE("DotRange", false, false, false, STRING), FILLORDER("FillOrder", true, false, false, INT16U), FORWARDMATRIX1("ForwardMatrix1", true, false, false, RAT64S), FORWARDMATRIX2("ForwardMatrix2", true, false, false, RAT64S), GRAYRESPONSEUNIT("GrayResponseUnit", false, false, false, INT16U), HALFTONEHINTS("HalftoneHints", false, false, false, INT16U), HOSTCOMPUTER("HostComputer", false, false, false, STRING), IMAGEDESCRIPTION("ImageDescription", false, false, false, STRING), IMAGEHEIGHT("ImageHeight", true, false, false, INT32U), IMAGESOURCEDATA("ImageSourceData", true, false, false, UNDEF), IMAGEWIDTH("ImageWidth", true, false, false, INT32U), INKSET("InkSet", false, false, false, INT16U), IPTCNAA("IPTC-NAA", true, false, false, INT32U), LINEARRESPONSELIMIT("LinearResponseLimit", true, false, false, RAT64U), LOCALIZEDCAMERAMODEL("LocalizedCameraModel", false, false, false, STRING), MAKE("Make", false, false, false, STRING), MAKERNOTESAFETY("MakerNoteSafety", false, false, false, INT16U), MAXSAMPLEVALUE("MaxSampleValue", false, false, false, INT16U), MINSAMPLEVALUE("MinSampleValue", false, false, false, INT16U), MODEL("Model", false, false, false, STRING), MODIFYDATE("ModifyDate", false, false, false, STRING), OLDSUBFILETYPE("OldSubfileType", true, false, false, INT16U), ORIENTATION("Orientation", false, false, false, INT16U), ORIGINALRAWFILEDATA("OriginalRawFileData", true, false, false, UNDEF), ORIGINALRAWFILEDIGEST("OriginalRawFileDigest", true, false, false, INT8U), ORIGINALRAWFILENAME("OriginalRawFileName", true, false, false, STRING), PAGENAME("PageName", false, false, false, STRING), PAGENUMBER("PageNumber", false, false, false, INT16U), PANASONICTITLE("PanasonicTitle", false, false, false, UNDEF), PANASONICTITLE2("PanasonicTitle2", false, false, false, UNDEF), PHOTOMETRICINTERPRETATION("PhotometricInterpretation", true, false, false, INT16U), PLANARCONFIGURATION("PlanarConfiguration", true, false, false, INT16U), PREDICTOR("Predictor", true, false, false, INT16U), PREVIEWAPPLICATIONNAME("PreviewApplicationName", true, false, false, STRING), PREVIEWAPPLICATIONVERSION("PreviewApplicationVersion", true, false, false, STRING), PREVIEWCOLORSPACE("PreviewColorSpace", true, false, false, INT32U), PREVIEWDATETIME("PreviewDateTime", true, false, false, STRING), PREVIEWSETTINGSDIGEST("PreviewSettingsDigest", true, false, false, INT8U), PREVIEWSETTINGSNAME("PreviewSettingsName", true, false, false, STRING), PRIMARYCHROMATICITIES("PrimaryChromaticities", false, false, false, RAT64U), PRINTIM("PrintIM", false, false, false, UNDEF), PROCESSINGSOFTWARE("ProcessingSoftware", false, false, false, STRING), PROFILECALIBRATIONSIG("ProfileCalibrationSig", true, false, false, STRING), PROFILECOPYRIGHT("ProfileCopyright", true, false, false, STRING), PROFILEEMBEDPOLICY("ProfileEmbedPolicy", true, false, false, INT32U), PROFILEHUESATMAPDATA1("ProfileHueSatMapData1", true, false, false, FLOAT), PROFILEHUESATMAPDATA2("ProfileHueSatMapData2", true, false, false, FLOAT), PROFILEHUESATMAPDIMS("ProfileHueSatMapDims", true, false, false, INT32U), PROFILELOOKTABLEDATA("ProfileLookTableData", true, false, false, FLOAT), PROFILELOOKTABLEDIMS("ProfileLookTableDims", true, false, false, INT32U), PROFILENAME("ProfileName", true, false, false, STRING), PROFILETONECURVE("ProfileToneCurve", true, false, false, FLOAT), RATING("Rating", false, true, false, INT16U), RATINGPERCENT("RatingPercent", false, true, false, INT16U), RAWDATAUNIQUEID("RawDataUniqueID", true, false, false, INT8U), RAWIMAGEDIGEST("RawImageDigest", true, false, false, INT8U), REDUCTIONMATRIX1("ReductionMatrix1", true, false, false, RAT64S), REDUCTIONMATRIX2("ReductionMatrix2", true, false, false, RAT64S), REFERENCEBLACKWHITE("ReferenceBlackWhite", false, false, false, RAT64U), RESOLUTIONUNIT("ResolutionUnit", false, false, false, INT16U), ROWSPERSTRIP("RowsPerStrip", true, false, false, INT32U), SAMPLESPERPIXEL("SamplesPerPixel", true, false, false, INT16U), SEMINFO("SEMInfo", false, false, false, STRING), SHADOWSCALE("ShadowScale", true, false, false, RAT64U), SOFTWARE("Software", false, false, false, STRING), SUBFILETYPE("SubfileType", true, false, false, INT32U), THRESHOLDING("Thresholding", true, false, false, INT16U), TILELENGTH("TileLength", true, false, false, INT32U), TILEWIDTH("TileWidth", true, false, false, INT32U), TRANSFERFUNCTION("TransferFunction", true, false, false, INT16U), UNIQUECAMERAMODEL("UniqueCameraModel", false, false, false, STRING), WHITEPOINT("WhitePoint", false, false, false, RAT64U), XPAUTHOR("XPAuthor", false, false, false, INT8U), XPCOMMENT("XPComment", false, false, false, INT8U), XPKEYWORDS("XPKeywords", false, false, false, INT8U), XPOSITION("XPosition", false, false, false, RAT64U), XPSUBJECT("XPSubject", false, false, false, INT8U), XPTITLE("XPTitle", false, false, false, INT8U), XRESOLUTION("XResolution", false, false, false, RAT64U), YCBCRCOEFFICIENTS("YCbCrCoefficients", true, false, false, RAT64U), YCBCRPOSITIONING("YCbCrPositioning", true, false, false, INT16U), YCBCRSUBSAMPLING("YCbCrSubSampling", true, false, false, INT16U), YPOSITION("YPosition", false, false, false, RAT64U), YRESOLUTION("YResolution", false, false, false, RAT64U), INTEROPINDEX("InteropIndex", true, false, false, STRING), INTEROPVERSION("InteropVersion", true, false, false, UNDEF), RELATEDIMAGEFILEFORMAT("RelatedImageFileFormat", true, false, false, STRING), RELATEDIMAGEHEIGHT("RelatedImageHeight", true, false, false, INT16U), RELATEDIMAGEWIDTH("RelatedImageWidth", true, false, false, INT16U), ACTIVEAREA("ActiveArea", true, false, false, INT32U), ANTIALIASSTRENGTH("AntiAliasStrength", true, false, false, RAT64U), BAYERGREENSPLIT("BayerGreenSplit", true, false, false, INT32U), BESTQUALITYSCALE("BestQualityScale", true, false, false, RAT64U), BLACKLEVEL("BlackLevel", true, false, false, RAT64U), BLACKLEVELREPEATDIM("BlackLevelRepeatDim", true, false, false, INT16U), CHROMABLURRADIUS("ChromaBlurRadius", true, false, false, RAT64U), DEFAULTCROPORIGIN("DefaultCropOrigin", true, false, false, INT32U), DEFAULTCROPSIZE("DefaultCropSize", true, false, false, INT32U), DEFAULTSCALE("DefaultScale", true, false, false, RAT64U), LINEARIZATIONTABLE("LinearizationTable", true, false, false, INT16U), MASKEDAREAS("MaskedAreas", true, false, false, INT32U), NOISEREDUCTIONAPPLIED("NoiseReductionApplied", true, false, false, RAT64U), WHITELEVEL("WhiteLevel", true, false, false, INT32U);
+
 	private final boolean avoided;
 	private final boolean unsafe;
 	private final boolean protectedField;
 	private final String name;
-	private final DataType type; 
+	private final DataType type;
 	private static final Map<String, IFD0> TAG_LOOKUP_MAP;
-	
-
-	
 
 	/**
 	 * @param avoided
 	 * @param name
 	 * @param type
 	 */
-	private IFD0(String name, boolean unsafe, boolean avoided, boolean protectedField, DataType type) {
+	private IFD0(final String name, final boolean unsafe, final boolean avoided, final boolean protectedField, final DataType type) {
 		this.avoided = avoided;
 		this.unsafe = unsafe;
 		this.protectedField = protectedField;
 			TAG_LOOKUP_MAP.put(tag.name, tag);
 		}
 	}
-	
+
 	/**
 	 * Used to get the {@link Tag} identified by the given, case-sensitive, tag name.
 	 * @param name The case-sensitive name of the tag that will be searched for.
 		return TAG_LOOKUP_MAP.get(name);
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#isAvoided()
 	 */
 	@Override
 		return avoided;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#isUnsafe()
 	 */
 	@Override
 		return unsafe;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#isProtectedField()
 	 */
 	@Override
 		return protectedField;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#getName()
 	 */
 	@Override
 		return name;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see be.pw.jexif.enums.tag.Tag#getType()
 	 */
 	@Override
 	public final DataType getType() {
 		return type;
 	}
-	
+
 }

File src/be/pw/jexif/enums/tag/Tag.java

 	 * @return the type
 	 */
 	DataType getType();
-	
+
 }

File src/be/pw/jexif/internal/action/impl/TagReadAction.java

  ******************************************************************************/
 package be.pw.jexif.internal.action.impl;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.enums.tag.Tag;
 import be.pw.jexif.exception.JExifException;
 import be.pw.jexif.internal.constants.ExecutionConstant;
 import be.pw.jexif.internal.util.ArrayUtil;
 import be.pw.jexif.internal.util.Cal10nUtil;
-import com.google.common.base.Preconditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
+import com.google.common.base.Preconditions;
 
 /**
  * Action to read an EXIF-tag.
- *
  * @author phillip
  */
 public class TagReadAction extends AbstractAction implements IAction {
-    /**
-     * The logger for this class.
-     */
-    private static final Logger LOG = LoggerFactory.getLogger(TagReadAction.class);
+	/**
+	 * The logger for this class.
+	 */
+	private static final Logger LOG = LoggerFactory.getLogger(TagReadAction.class);
 
-    /**
-     * Hidden constructor. All initializations should occur from the {@link ActionFactory}.
-     */
-    TagReadAction() {
-        super();
-    }
+	/**
+	 * Hidden constructor. All initializations should occur from the {@link ActionFactory}.
+	 */
+	TagReadAction() {
+		super();
+	}
 
-    /**
-     * Alows settings the required parameters. AnnotationValidation is possible.
-     *
-     * @param file the file from which the provided Tags should be read.
-     * @param tags the Tags that must be read from the provided file.
-     */
-    public void setParams(final File file, final Tag... tags) {
-        Preconditions.checkNotNull(file);
-        Preconditions.checkNotNull(tags);
-        Preconditions.checkArgument(tags.length != 0, Cal10nUtil.get(Errors.VALIDATION_TAGLIST));
-        this.file = file;
-        this.tags = new HashSet<>();
-        for (Tag tag : tags) {
-            LOG.trace("Adding tag {}", tag.getName());
-            this.tags.add(tag);
-        }
-    }
+	/**
+	 * Alows settings the required parameters. AnnotationValidation is possible.
+	 * @param file the file from which the provided Tags should be read.
+	 * @param tags the Tags that must be read from the provided file.
+	 */
+	public void setParams(final File file, final Tag... tags) {
+		Preconditions.checkNotNull(file);
+		Preconditions.checkNotNull(tags);
+		Preconditions.checkArgument(tags.length != 0, Cal10nUtil.get(Errors.VALIDATION_TAGLIST));
+		this.file = file;
+		this.tags = new HashSet<>();
+		for (Tag tag : tags) {
+			LOG.trace("Adding tag {}", tag.getName());
+			this.tags.add(tag);
+		}
+	}
 
-    /**
-     * {@inheritDoc}
-     *
-     * @throws JExifException in case of an IO-Exception or an IndexOutOfBoundException.
-     */
-    @Override
-    public String[] buildArguments() throws JExifException {
-        try {
-            int size = tags.size() + 7;
-            String[] arguments = new String[size];
-            int i = 0;
-            arguments[i++] = ExecutionConstant.ECHO;
-            arguments[i++] = ExecutionConstant.START + " " + getId();
-            for (Tag tag : tags) {
-                arguments[i++] = "-" + tag.getName();
-            }
-            arguments[i++] = ExecutionConstant.SHORT_FORMAT;
-            arguments[i++] = file.getCanonicalPath();
-            arguments[i++] = ExecutionConstant.ECHO;
-            arguments[i++] = ExecutionConstant.STOP + " " + getId();
-            arguments[i] = ExecutionConstant.EXECUTE;
-            LOG.trace("Arguments are : " + ArrayUtil.toString(arguments));
-            return arguments;
-        } catch (IOException e) {
-            LOG.error(Cal10nUtil.get(Errors.IO_BUILD_ARGUMENTS), e);
-            throw new JExifException(e);
-        } catch (IndexOutOfBoundsException e) {
-            LOG.error("Oops", e);
-            throw new JExifException(e);
-        }
-    }
+	/**
+	 * {@inheritDoc}
+	 * @throws JExifException in case of an IO-Exception or an IndexOutOfBoundException.
+	 */
+	@Override
+	public String[] buildArguments() throws JExifException {
+		try {
+			int size = tags.size() + 7;
+			String[] arguments = new String[size];
+			int i = 0;
+			arguments[i++] = ExecutionConstant.ECHO;
+			arguments[i++] = ExecutionConstant.START + " " + getId();
+			for (Tag tag : tags) {
+				arguments[i++] = "-" + tag.getName();
+			}
+			arguments[i++] = ExecutionConstant.SHORT_FORMAT;
+			arguments[i++] = file.getCanonicalPath();
+			arguments[i++] = ExecutionConstant.ECHO;
+			arguments[i++] = ExecutionConstant.STOP + " " + getId();
+			arguments[i] = ExecutionConstant.EXECUTE;
+			LOG.trace("Arguments are : " + ArrayUtil.toString(arguments));
+			return arguments;
+		} catch (IOException e) {
+			LOG.error(Cal10nUtil.get(Errors.IO_BUILD_ARGUMENTS), e);
+			throw new JExifException(e);
+		} catch (IndexOutOfBoundsException e) {
+			LOG.error("Oops", e);
+			throw new JExifException(e);
+		}
+	}
 }

File src/be/pw/jexif/internal/action/impl/TagWriteAction.java

  ******************************************************************************/
 package be.pw.jexif.internal.action.impl;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.enums.tag.Tag;
 import be.pw.jexif.exception.JExifException;
 import be.pw.jexif.internal.util.TagUtil;
 
 import com.google.common.base.Preconditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Map.Entry;
 
 /**
  * Action to write an Exif-Tag
  */
 public class TagWriteAction extends AbstractAction implements IAction {
 
-    TagWriteAction() {
+	TagWriteAction() {
 
-    }
+	}
 
-    /**
-     * The logger for this class.
-     */
-    private static final Logger LOG = LoggerFactory.getLogger(TagWriteAction.class);
+	/**
+	 * The logger for this class.
+	 */
+	private static final Logger LOG = LoggerFactory.getLogger(TagWriteAction.class);
 
-    /**
-     * Map with Tag-Value (write Value to Tag)
-     */
-    private Map<Tag, String> valuesToWrite;
+	/**
+	 * Map with Tag-Value (write Value to Tag)
+	 */
+	private Map<Tag, String> valuesToWrite;
 
-    /**
-     * Sets the params.
-     *
-     * @param file          the file from which you would like to change the Exif tag values.
-     * @param valuesToWrite a Map combining the Tag-Value combination. The value element shall be written to the Tag.<br />
-     *                      If you want to clear a Tag, just specify an empty String.
-     * @throws JExifException           if the give value is not of a valid type.
-     * @throws IllegalArgumentException if provided fields are null, empty or if trying to write to a protected/avoided/unsafe tag.
-     */
-    public void setParams(final File file, final Map<Tag, String> valuesToWrite) throws JExifException {
-        Preconditions.checkNotNull(file);
-        Preconditions.checkNotNull(valuesToWrite);
-        Preconditions.checkArgument(valuesToWrite.size() != 0, Cal10nUtil.get(Errors.VALIDATION_VALUESLIST));
-        for (Entry<Tag, String> entry : valuesToWrite.entrySet()) {
-            Preconditions.checkArgument(!entry.getKey().isUnsafe(), Cal10nUtil.get(Errors.VALIDATION_WRITE_UNSAFE_TAG, entry.getKey().getName()));
-            Preconditions.checkArgument(!entry.getKey().isProtectedField(), Cal10nUtil.get(Errors.VALIDATION_WRITE_PROTECTED_TAG, entry.getKey().getName()));
-            Preconditions.checkArgument(!entry.getKey().isAvoided(), Cal10nUtil.get(Errors.VALIDATION_WRITE_AVOIDED_TAG, entry.getKey().getName()));
-            TagUtil.validateValue(entry.getKey(), entry.getValue());
-        }
-        this.file = file;
-        this.valuesToWrite = valuesToWrite;
-    }
+	/**
+	 * Sets the params.
+	 * @param file the file from which you would like to change the Exif tag values.
+	 * @param valuesToWrite a Map combining the Tag-Value combination. The value element shall be written to the Tag.<br />
+	 *            If you want to clear a Tag, just specify an empty String.
+	 * @throws JExifException if the give value is not of a valid type.
+	 * @throws IllegalArgumentException if provided fields are null, empty or if trying to write to a protected/avoided/unsafe tag.
+	 */
+	public void setParams(final File file, final Map<Tag, String> valuesToWrite) throws JExifException {
+		Preconditions.checkNotNull(file);
+		Preconditions.checkNotNull(valuesToWrite);
+		Preconditions.checkArgument(valuesToWrite.size() != 0, Cal10nUtil.get(Errors.VALIDATION_VALUESLIST));
+		for (Entry<Tag, String> entry : valuesToWrite.entrySet()) {
+			Preconditions.checkArgument(!entry.getKey().isUnsafe(), Cal10nUtil.get(Errors.VALIDATION_WRITE_UNSAFE_TAG, entry.getKey().getName()));
+			Preconditions.checkArgument(!entry.getKey().isProtectedField(), Cal10nUtil.get(Errors.VALIDATION_WRITE_PROTECTED_TAG, entry.getKey().getName()));
+			Preconditions.checkArgument(!entry.getKey().isAvoided(), Cal10nUtil.get(Errors.VALIDATION_WRITE_AVOIDED_TAG, entry.getKey().getName()));
+			TagUtil.validateValue(entry.getKey(), entry.getValue());
+		}
+		this.file = file;
+		this.valuesToWrite = valuesToWrite;
+	}
 
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String[] buildArguments() throws JExifException {
-        try {
-            int size = valuesToWrite.size() + 7;
-            String[] arguments = new String[size];
-            int i = 0;
-            arguments[i++] = ExecutionConstant.ECHO;
-            arguments[i++] = ExecutionConstant.START + " " + getId();
-            for (Entry<Tag, String> tag : valuesToWrite.entrySet()) {
-                arguments[i++] = "-" + tag.getKey().getName() + "=" + tag.getValue();
-            }
-            arguments[i++] = ExecutionConstant.EXACT_VALUE;
-            arguments[i++] = file.getCanonicalPath();
-            arguments[i++] = ExecutionConstant.ECHO;
-            arguments[i++] = ExecutionConstant.STOP + " " + getId();
-            arguments[i] = ExecutionConstant.EXECUTE;
-            LOG.trace("Arguments are : " + ArrayUtil.toString(arguments));
-            return arguments;
-        } catch (IOException e) {
-            LOG.error(Cal10nUtil.get(Errors.IO_BUILD_ARGUMENTS), e);
-            throw new JExifException(e);
-        } catch (IndexOutOfBoundsException e) {
-            LOG.error("Oops", e);
-            throw new JExifException(e);
-        }
-    }
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public String[] buildArguments() throws JExifException {
+		try {
+			int size = valuesToWrite.size() + 7;
+			String[] arguments = new String[size];
+			int i = 0;
+			arguments[i++] = ExecutionConstant.ECHO;
+			arguments[i++] = ExecutionConstant.START + " " + getId();
+			for (Entry<Tag, String> tag : valuesToWrite.entrySet()) {
+				arguments[i++] = "-" + tag.getKey().getName() + "=" + tag.getValue();
+			}
+			arguments[i++] = ExecutionConstant.EXACT_VALUE;
+			arguments[i++] = file.getCanonicalPath();
+			arguments[i++] = ExecutionConstant.ECHO;
+			arguments[i++] = ExecutionConstant.STOP + " " + getId();
+			arguments[i] = ExecutionConstant.EXECUTE;
+			LOG.trace("Arguments are : " + ArrayUtil.toString(arguments));
+			return arguments;
+		} catch (IOException e) {
+			LOG.error(Cal10nUtil.get(Errors.IO_BUILD_ARGUMENTS), e);
+			throw new JExifException(e);
+		} catch (IndexOutOfBoundsException e) {
+			LOG.error("Oops", e);
+			throw new JExifException(e);
+		}
+	}
 }

File src/be/pw/jexif/internal/constants/ExecutionConstant.java

 	public static final String LINUX_CLA = "{0} " + STAY_OPEN + " true -@ {1}";
 
 	public static final String MAC_CLA = "{0} " + STAY_OPEN + " true -@ \"{1}\"";
-	
+
 	public static final String[] WARNINGS_TO_IGNORE = {};
 
 }

File src/be/pw/jexif/internal/result/ResultHandler.java

  ******************************************************************************/
 package be.pw.jexif.internal.result;
 
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.exception.ExifError;
 import be.pw.jexif.exception.JExifException;
 import be.pw.jexif.internal.action.IAction;
 import be.pw.jexif.internal.result.impl.ParserFactory;
 import be.pw.jexif.internal.util.Cal10nUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.text.MessageFormat;
-import java.util.List;
 
 /**
  * The ResultHandler will be used to run over the different results and actions in order to match the output with the input.
- *
  * @author phillip
  */
 public class ResultHandler {
-    /**
-     * The logger for this class.
-     */
-    private static final Logger LOG = LoggerFactory.getLogger(ResultHandler.class);
+	/**
+	 * The logger for this class.
+	 */
+	private static final Logger LOG = LoggerFactory.getLogger(ResultHandler.class);
 
-    /**
-     * Threats the input- and error-messages for the given action.<br />
-     * A different result handler will be used based on the type of action passed to this method.
-     *
-     * @param action the action
-     * @param result the result-list for the given action.
-     * @param errors the error-list for the given action.
-     * @throws ExifError if the error-list is not empty (the ExifError will contain the error-messages).
-     */
-    public static void run(final IAction action, final List<String> result, final List<String> errors) throws ExifError {
-        if (errors != null && !errors.isEmpty()) {
-            boolean onlyWarnings = true;
-            StringBuilder b = new StringBuilder();
-            b.append(Cal10nUtil.get(Errors.EXIFTOOL_EXECUTION_WARNING));
-            for (String s : errors) {
-                if (!s.toLowerCase().contains("warning")) {
-                    onlyWarnings = false;
-                    b.append(" > ").append(s);
-                }
-            }
-            if (!onlyWarnings) {
-                LOG.error(Cal10nUtil.get(Errors.EXIFTOOL_EXECUTION_ERROR, b.toString()));
-                throw new ExifError(b.toString());
-            }
-        }
-        IResultParser parser;
+	/**
+	 * Threats the input- and error-messages for the given action.<br />
+	 * A different result handler will be used based on the type of action passed to this method.
+	 * @param action the action
+	 * @param result the result-list for the given action.
+	 * @param errors the error-list for the given action.
+	 * @throws ExifError if the error-list is not empty (the ExifError will contain the error-messages).
+	 */
+	public static void run(final IAction action, final List<String> result, final List<String> errors) throws ExifError {
+		if (errors != null && !errors.isEmpty()) {
+			boolean onlyWarnings = true;
+			StringBuilder b = new StringBuilder();
+			b.append(Cal10nUtil.get(Errors.EXIFTOOL_EXECUTION_WARNING));
+			for (String s : errors) {
+				if (!s.toLowerCase().contains("warning")) {
+					onlyWarnings = false;
+					b.append(" > ").append(s);
+				}
+			}
+			if (!onlyWarnings) {
+				LOG.error(Cal10nUtil.get(Errors.EXIFTOOL_EXECUTION_ERROR, b.toString()));
+				throw new ExifError(b.toString());
+			}
+		}
+		IResultParser parser;
 
-        String uid = action.getId();
-        LOG.trace("[{}] - Getting results", uid);
-        if (result != null && !result.isEmpty()) {
-            try {
-                LOG.trace("[{}] - {} results were found", uid, result.size());
-                parser = ParserFactory.getInstance(action);
-                LOG.trace("[{}] - Parser {} was retreived", uid, parser.getClass().getSimpleName());
-                parser.parse(action, uid, result);
-            } catch (JExifException e) {
-                LOG.error(Cal10nUtil.get(Errors.RETREIVE_PARSER_ERROR, uid), e);
-                LOG.warn("[{}] - There will be no results", uid);
-            }
-        } else {
-            LOG.warn("[{}] - No results were found", uid);
-        }
-    }
+		String uid = action.getId();
+		LOG.trace("[{}] - Getting results", uid);
+		if (result != null && !result.isEmpty()) {
+			try {
+				LOG.trace("[{}] - {} results were found", uid, result.size());
+				parser = ParserFactory.getInstance(action);
+				LOG.trace("[{}] - Parser {} was retreived", uid, parser.getClass().getSimpleName());
+				parser.parse(action, uid, result);
+			} catch (JExifException e) {
+				LOG.error(Cal10nUtil.get(Errors.RETREIVE_PARSER_ERROR, uid), e);
+				LOG.warn("[{}] - There will be no results", uid);
+			}
+		} else {
+			LOG.warn("[{}] - No results were found", uid);
+		}
+	}
 
 }

File src/be/pw/jexif/internal/result/impl/ParserFactory.java

  ******************************************************************************/
 package be.pw.jexif.internal.result.impl;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.exception.JExifException;
 import be.pw.jexif.internal.action.IAction;
 import be.pw.jexif.internal.action.impl.TagWriteAction;
 import be.pw.jexif.internal.result.IResultParser;
 import be.pw.jexif.internal.util.Cal10nUtil;
+
 import com.google.common.base.Preconditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Factory for creating the different parsers.
- *
  * @author phillip
  * @see be.pw.jexif.internal.result.IResultParser
  */
 public class ParserFactory {
-    /**
-     * The logger for this class.
-     */
-    private static final Logger LOG = LoggerFactory.getLogger(ParserFactory.class);
+	/**
+	 * The logger for this class.
+	 */
+	private static final Logger LOG = LoggerFactory.getLogger(ParserFactory.class);
 
-    /**
-     * Returns an instance of a parser for a given action instance.
-     *
-     * @param action the action for which you want a parser.
-     * @throws JExifException if the action is null or if an unknown action type is given.
-     */
-    public static IResultParser getInstance(final IAction action) throws JExifException {
-        Preconditions.checkNotNull(action);
-        if (action.getClass().equals(TagReadAction.class)) {
-            return new TagReadParser();
-        }
-        if (action.getClass().equals(TagReadExactAction.class)) {
-            return new TagReadExactParser();
-        }
-        if (action.getClass().equals(TagWriteAction.class)) {
-            return new TagWriteParser();
-        }
-        LOG.error(Cal10nUtil.get(Errors.PARSER_UNKNOWNTYPE, action.getClass().getName()));
-        throw new JExifException(Cal10nUtil.get(Errors.PARSER_UNKNOWNTYPE, action.getClass().getName()));
-    }
+	/**
+	 * Returns an instance of a parser for a given action instance.
+	 * @param action the action for which you want a parser.
+	 * @throws JExifException if the action is null or if an unknown action type is given.
+	 */
+	public static IResultParser getInstance(final IAction action) throws JExifException {
+		Preconditions.checkNotNull(action);
+		if (action.getClass().equals(TagReadAction.class)) {
+			return new TagReadParser();
+		}
+		if (action.getClass().equals(TagReadExactAction.class)) {
+			return new TagReadExactParser();
+		}
+		if (action.getClass().equals(TagWriteAction.class)) {
+			return new TagWriteParser();
+		}
+		LOG.error(Cal10nUtil.get(Errors.PARSER_UNKNOWNTYPE, action.getClass().getName()));
+		throw new JExifException(Cal10nUtil.get(Errors.PARSER_UNKNOWNTYPE, action.getClass().getName()));
+	}
 }

File src/be/pw/jexif/internal/result/impl/TagReadParser.java

  ******************************************************************************/
 package be.pw.jexif.internal.result.impl;
 
+import java.util.Iterator;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.enums.tag.Tag;
 import be.pw.jexif.exception.JExifException;
 import be.pw.jexif.internal.result.IResultParser;
 import be.pw.jexif.internal.util.Cal10nUtil;
 import be.pw.jexif.internal.util.TagUtil;
-import com.google.common.base.Splitter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import java.util.Iterator;
-import java.util.List;
+import com.google.common.base.Splitter;
 
 /**
  * Class which can be used to parse the output of a {@link be.pw.jexif.internal.action.impl.TagReadAction}.
- *
  * @author phillip
  */
 public class TagReadParser implements IResultParser {
 
-    private static final Logger LOG = LoggerFactory.getLogger(TagReadParser.class);
+	private static final Logger LOG = LoggerFactory.getLogger(TagReadParser.class);
 
-    /**
-     * Hidden constructor. <br />
-     * Use the factory instead.
-     */
-    TagReadParser() {
-    }
+	/**
+	 * Hidden constructor. <br />
+	 * Use the factory instead.
+	 */
+	TagReadParser() {
+	}
 
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public final void parse(final IAction action, final String actionUID, final List<String> result) throws JExifException {
-        if (!action.getClass().equals(validFor())) {
-            throw new JExifException(Cal10nUtil.get(Errors.PARSER_MISMATCH, getClass().getSimpleName(), action.getClass().getSimpleName()));
-        }
-        if (!action.getId().equals(actionUID)) {
-            throw new JExifException("Invalid action UID");
-        }
-        Tag t;
-        String r;
-        for (String line : result) {
-            if (!line.contains(ExecutionConstant.EXIFTOOLREADY) && !line.isEmpty() && line.contains(":")) {
-                Iterable<String> output = Splitter.on(":").limit(2).omitEmptyStrings().trimResults().split(line);
-                Iterator<String> i = output.iterator();
-                t = TagUtil.forName(i.next());
-                if (i.hasNext()) {	//result exists
-                	r = i.next();
-                } else {
-                	r = null;
-                }
-                if (i.hasNext()) {
-                    LOG.warn("More values exist in the iterator for line: {}", line);
-                }
-                if (t != null && r != null && !r.isEmpty()) {
-                    LOG.trace("Found results {} for Tag {}", r, t.getName());
-                    action.addResult(t, r);
-                } else {
-                    LOG.warn("Could not add result {0}", line);
-                }
-            }
-        }
-    }
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public final void parse(final IAction action, final String actionUID, final List<String> result) throws JExifException {
+		if (!action.getClass().equals(validFor())) {
+			throw new JExifException(Cal10nUtil.get(Errors.PARSER_MISMATCH, getClass().getSimpleName(), action.getClass().getSimpleName()));
+		}
+		if (!action.getId().equals(actionUID)) {
+			throw new JExifException("Invalid action UID");
+		}
+		Tag t;
+		String r;
+		for (String line : result) {
+			if (!line.contains(ExecutionConstant.EXIFTOOLREADY) && !line.isEmpty() && line.contains(":")) {
+				Iterable<String> output = Splitter.on(":").limit(2).omitEmptyStrings().trimResults().split(line);
+				Iterator<String> i = output.iterator();
+				t = TagUtil.forName(i.next());
+				if (i.hasNext()) { // result exists
+					r = i.next();
+				} else {
+					r = null;
+				}
+				if (i.hasNext()) {
+					LOG.warn("More values exist in the iterator for line: {}", line);
+				}
+				if (t != null && r != null && !r.isEmpty()) {
+					LOG.trace("Found results {} for Tag {}", r, t.getName());
+					action.addResult(t, r);
+				} else {
+					LOG.warn("Could not add result {0}", line);
+				}
+			}
+		}
+	}
 
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public Class<? extends IAction> validFor() {
-        return TagReadAction.class;
-    }
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public Class<? extends IAction> validFor() {
+		return TagReadAction.class;
+	}
 }

File src/be/pw/jexif/internal/result/impl/TagWriteParser.java

  ******************************************************************************/
 package be.pw.jexif.internal.result.impl;
 
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import be.pw.jexif.enums.Errors;
 import be.pw.jexif.exception.JExifException;
 import be.pw.jexif.internal.action.IAction;
 import be.pw.jexif.internal.constants.ExecutionConstant;
 import be.pw.jexif.internal.result.IResultParser;
 import be.pw.jexif.internal.util.Cal10nUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
 
 public class TagWriteParser implements IResultParser {
 
-    private static final Logger LOG = LoggerFactory.getLogger(TagWriteParser.class);
-
-    TagWriteParser() {
-    }
-
-    @Override
-    public void parse(final IAction action, final String actionUID, final List<String> result) throws JExifException {
-        if (!action.getClass().equals(validFor())) {
-            throw new JExifException(Cal10nUtil.get(Errors.PARSER_MISMATCH, getClass().getSimpleName(), action.getClass().getSimpleName()));
-        }
-        if (!action.getId().equals(actionUID)) {
-            throw new JExifException("Invalid action UID");
-        }
-        for (String line : result) {
-            if (!line.contains(ExecutionConstant.EXIFTOOLREADY) && !line.isEmpty()) {
-                LOG.trace(line);
-            }
-        }
-    }
-
-    @Override
-    public Class<? extends IAction> validFor() {
-        return TagWriteAction.class;
-    }
+	private static final Logger LOG = LoggerFactory.getLogger(TagWriteParser.class);
+
+	TagWriteParser() {
+	}
+
+	@Override
+	public void parse(final IAction action, final String actionUID, final List<String> result) throws JExifException {
+		if (!action.getClass().equals(validFor())) {
+			throw new JExifException(Cal10nUtil.get(Errors.PARSER_MISMATCH, getClass().getSimpleName(), action.getClass().getSimpleName()));
+		}
+		if (!action.getId().equals(actionUID)) {
+			throw new JExifException("Invalid action UID");
+		}
+		for (String line : result) {
+			if (!line.contains(ExecutionConstant.EXIFTOOLREADY) && !line.isEmpty()) {
+				LOG.trace(line);
+			}
+		}
+	}
+
+	@Override
+	public Class<? extends IAction> validFor() {
+		return TagWriteAction.class;
+	}
 }

File src/be/pw/jexif/internal/util/DateUtil.java

 public class DateUtil {
 
 	public static final DateFormat fmt = new SimpleDateFormat("YYYY:MM:dd HH:mm:ss.SS XXX");
-	
-	public static String fromDate(Date date) {
+
+	public static String fromDate(final Date date) {
 		return fmt.format(date);
 	}
-	
-	public static Date toDate(String date) throws ParseException {
+
+	public static Date toDate(final String date) throws ParseException {
 		return fmt.parse(date);
 	}
 }

File src/be/pw/jexif/internal/util/TagUtil.java

 		return TAG_LOOKUP_MAP.get(name);
 	}
 
-	public static void validateValue(Tag tag, String value) throws JExifException {
+	public static void validateValue(final Tag tag, final String value) throws JExifException {
 		DataType type = tag.getType();
 		Exception ex = null;
 		Errors error = null;
 					break;
 				}
 			} catch (NumberFormatException e) {
-				//There is the possibility that the value is too big to fit in a Double
+				// There is the possibility that the value is too big to fit in a Double
 				int l = Double.toString(Double.MAX_VALUE).length();
-				if (value.length() < l) {	//not valid number
+				if (value.length() < l) { // not valid number
 					error = Errors.VALIDATION_INVALID_TYPE;