Index: trunk/org.etsi.common/.classpath
===================================================================
--- trunk/org.etsi.common/.classpath	(revision 7)
+++ trunk/org.etsi.common/.classpath	(revision 7)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="lib/xstream-1.3.1.jar"/>
+	<classpathentry kind="lib" path="lib/commons-cli-1.2.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: trunk/org.etsi.common/.project
===================================================================
--- trunk/org.etsi.common/.project	(revision 7)
+++ trunk/org.etsi.common/.project	(revision 7)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.etsi.common</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: trunk/org.etsi.common/build.xml
===================================================================
--- trunk/org.etsi.common/build.xml	(revision 7)
+++ trunk/org.etsi.common/build.xml	(revision 7)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project basedir="." default="compile" name="org.etsi.common">
+    <property name="src" value="src"/>
+    <property name="bin" value="bin"/>
+    <property name="lib" value="lib"/>
+    <property name="dist" value="dist"/>
+    <property name="antlib" value="antlib"/>
+    <property name="nsis" value="nsis"/>
+	<property name="cp" value="${lib}/xstream-1.3.1.jar:${lib}/commons-cli-1.2.jar:"/>
+
+    <target name="init">
+        <mkdir dir="${bin}"/>
+    </target>
+
+    <target name="clean" description="Removes previous build">
+      <delete includeEmptyDirs="true">
+        <fileset dir="${bin}"/>
+      </delete>
+    </target>
+
+   	<target name="compile" depends="init">
+        <javac srcdir="${src}" destdir="${bin}" classpath="${cp}"/>
+    </target>
+	
+    <target name="make-dist" depends="compile" description="Creates an ETSI MiscTools distribution directory">
+        <echo>Building ETSI MiscTools Distribution in ${dist}...</echo>
+        <delete includeEmptyDirs="true">
+            <fileset dir="${dist}"/>
+        </delete>
+        <jar destfile="${lib}/org.etsi.common.jar" basedir="${bin}/"/> 
+        <mkdir dir="${dist}"/>
+        <mkdir dir="${dist}/lib"/>
+        <copy todir="${dist}/lib">
+        	<fileset dir="${lib}"/>
+        </copy>
+    </target>
+
+
+</project>
Index: trunk/org.etsi.common/lib/LICENSE.txt
===================================================================
--- trunk/org.etsi.common/lib/LICENSE.txt	(revision 7)
+++ trunk/org.etsi.common/lib/LICENSE.txt	(revision 7)
@@ -0,0 +1,202 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
Index: trunk/org.etsi.common/lib/xstream-license.txt
===================================================================
--- trunk/org.etsi.common/lib/xstream-license.txt	(revision 7)
+++ trunk/org.etsi.common/lib/xstream-license.txt	(revision 7)
@@ -0,0 +1,28 @@
+(BSD Style License)
+
+Copyright (c) 2003-2006, Joe Walnes
+Copyright (c) 2006-2007, XStream Committers
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of
+conditions and the following disclaimer. Redistributions in binary form must reproduce
+the above copyright notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the distribution.
+
+Neither the name of XStream nor the names of its contributors may be used to endorse
+or promote products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
Index: trunk/org.etsi.common/src/org/etsi/common/ExtensionFilter.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/ExtensionFilter.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/ExtensionFilter.java	(revision 7)
@@ -0,0 +1,45 @@
+package org.etsi.common;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class ExtensionFilter implements FileFilter {
+
+	private String extRegExp = "";
+
+	public ExtensionFilter(String extRegExp) {
+		this.extRegExp = extRegExp;
+	}
+
+	public static String getFileExtension(String filename) {
+		String ext = "";
+		new File(filename);
+		int i = filename.lastIndexOf('.');
+		if (i > 0 && i < filename.length() - 1) {
+			ext = filename.substring(i + 1).toLowerCase();
+		}
+		return ext;
+	}
+
+	public static boolean checkFileExtension(File file, String regExp){
+		Pattern extPattern = Pattern.compile(regExp);
+		Matcher extMatcher = extPattern.matcher(getFileExtension(file.getName()));
+			if (extMatcher.matches()) {
+				return true;
+			}
+
+		return false;
+	}
+	
+	public boolean accept(File filename) {
+		if (filename.isFile()) {
+			if (checkFileExtension(filename, this.extRegExp)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/InputInterface.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/InputInterface.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/InputInterface.java	(revision 7)
@@ -0,0 +1,186 @@
+package org.etsi.common;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+public class InputInterface {
+	//TODO: can be transformed to static
+	
+	private String projectExt = "t3p";
+	private String extRegExp = "ttcn|ttcn3";
+	private boolean recursive = true;
+
+	public InputInterface(String resourceExtRegExp, boolean recursive){
+		this.extRegExp = resourceExtRegExp;
+		this.recursive = recursive;
+	}
+
+	
+	public InputInterface(String resourceExtRegExp, String projectExt, boolean recursive){
+		this.extRegExp = resourceExtRegExp;
+		this.projectExt = projectExt;
+		this.recursive = recursive;
+	}
+	
+	public void setExtRegExp(String extRegExp) {
+		this.extRegExp = extRegExp;
+	}
+
+	public String getExtRegExp() {
+		return extRegExp;
+	}
+
+	public void setRecursive(boolean recursive) {
+		this.recursive = recursive;
+	}
+
+	public boolean isRecursive() {
+		return recursive;
+	}
+	
+	public List<String> inputFromFile(String filename){
+		List<String> files = new LinkedList<String>();
+		File file = new File(filename);
+		if (file.isFile() && ExtensionFilter.checkFileExtension(file, extRegExp)){
+			files.add(file.getPath());
+		}
+		return files;
+	}
+
+	public List<String> inputFromDirectory(String directory){
+		List<String> files = new LinkedList<String>();
+		File inputDir = new File(directory);
+		File[] fileList = inputDir.listFiles(new ExtensionFilter(this.getExtRegExp()));
+
+		for (int i = 0; i < fileList.length; i++) {
+			files.add(fileList[i].getPath());
+		}
+
+		File[] dirList = inputDir.listFiles(new FileFilter() {
+			public boolean accept(File pathname) {
+				if (pathname.isDirectory())
+					return true;
+				return false;
+			}
+		});
+
+		if (this.isRecursive()){
+			for (int i = 0; i < dirList.length; i++) {
+				files.addAll(inputFromDirectory(dirList[i].getPath()));
+			}
+		}
+		
+		return files;
+	}
+
+	public List<String> inputFromWildcard(String wildcard){
+		List<String> files = new LinkedList<String>();
+		File wildcardFile = new File(wildcard);
+		System.out.println("Expanding wildcard \""+wildcard+"\"...");
+		File wildcardParentFile = wildcardFile.getParentFile();
+		if (wildcardParentFile == null) {
+			wildcardParentFile = new File(".");
+		}
+		//TODO: needs to check if it is null and handle the situation
+		if (wildcardParentFile.isDirectory()){
+			File[] fileList = wildcardParentFile.listFiles(new WildcardFilter(wildcardFile));
+			for (int i = 0; i < fileList.length; i++) {
+				System.out.println("      ->"+fileList[i].getPath());
+				files.addAll(this.getInputFromParameter(fileList[i].getPath()));
+			}
+		} else {
+			//invalid parent directory, return
+		}
+		if (files.isEmpty()) {
+			System.out.println("      ->No files found!");
+		}
+		return files;
+	}
+
+	public List<String> inputFromProject(String projectFilename){
+		List<String> files = new LinkedList<String>();
+		System.out.println("Reading input files from project file \""+projectFilename+"\"...");
+		//TODO: Fill with content
+		String projectFile = MiscTools.readFile(projectFilename);
+		String[] lines = projectFile.split("\n");
+		for (String line : lines) {
+			if (!line.matches("\\s*")) {//.equals("")) {
+				System.out.println("  "+line);
+				files.addAll(this.getInputFromParameter(line));
+			}
+		}
+		return files;
+	}
+
+	public void addToProject(List<String> files, String projectFilename){
+		//TODO: Fill with content		
+	}
+	
+	//TODO: this will make other duplicate checks obsolete
+	public static List<String> filterAbsoluteDuplicates(List<String> inputFiles) {
+		List<String> filteredInputFiles = new LinkedList<String>();
+		List<String> absolutePaths = new LinkedList<String>();
+		for (String inputFile : inputFiles) {
+			try {
+				String canonicalPath = new File(inputFile).getCanonicalPath();
+				if (!absolutePaths.contains(canonicalPath)) {
+					absolutePaths.add(canonicalPath);
+					filteredInputFiles.add(inputFile);
+				}
+			} catch (IOException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		return filteredInputFiles;
+	}
+	
+	//TODO: review, may be superfluous
+	public List<String> getInputFromParameterList(List<String> parameters) {
+		List<String> inputFiles = new LinkedList<String>();
+		for (int i = 0; i < parameters.size(); i++) {
+			List<String> fileList = getInputFromParameter(parameters.get(i));
+			for (int f = 0; f < fileList.size(); f++) {
+				String filename = fileList.get(f);
+				if (!inputFiles.contains(filename)) {
+					inputFiles.add(filename);
+				} else {
+					System.out.println("Entry \"" + filename
+							+ "\" already present in the list, skipping..");
+				}
+			}
+		}
+		return inputFiles;
+	}
+
+	
+	public List<String> getInputFromParameter(String inputParameter){
+		List<String> inputFiles = new LinkedList<String>();
+		File inputParameterFile = new File(inputParameter.trim());
+		if (inputParameterFile.isDirectory()){
+			if (this.isRecursive()){
+				System.out.println("Collecting ttcn3 files recursively in \""
+						+ inputParameter + "\" ...");
+			} else {
+				System.out.println("Collecting ttcn3 files non-recursively in \""
+						+ inputParameter + "\" ...");
+			}
+			inputFiles = inputFromDirectory(inputParameter);
+		} else {
+			if (inputParameterFile.isFile()){
+				if (inputParameterFile.getName().endsWith("."+projectExt)){
+					inputFiles = inputFromProject(inputParameter);
+				} else {
+					inputFiles = inputFromFile(inputParameter);
+				}
+			} else {
+				inputFiles = inputFromWildcard(inputParameter);
+			}
+		}
+		return inputFiles;
+	}
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/MiscTools.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/MiscTools.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/MiscTools.java	(revision 7)
@@ -0,0 +1,182 @@
+package org.etsi.common;
+
+import java.io.BufferedWriter;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.text.DecimalFormat;
+
+import org.etsi.common.exceptions.TerminationException;
+
+
+public class MiscTools {
+
+	//TODO: Add exceptions and throws declarations
+	public static String readFile(String filename) {
+		FileInputStream fis;
+		String content = "";
+		try {
+			fis = new FileInputStream(filename);
+			int x = fis.available();
+			byte b[] = new byte[x];
+			fis.read(b);
+			content = new String(b);
+		} catch (FileNotFoundException e) {
+			String message = "IO ERROR: Filename "+filename+" cannot be found for reading!";
+			try {
+				throw new TerminationException(message);
+			} catch (TerminationException e1) {
+			}
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		return content;
+	}
+
+	public static String getShortFilename(String filename) {
+		String shortfilename = new File(filename).getName();
+		return shortfilename;
+	}
+
+	public static String getMethodName(){
+		return Thread.currentThread().getStackTrace()[2].getMethodName();
+	}
+	
+	
+	public static void writeFile(String filename, String content) {
+		FileOutputStream fos;
+		File targetDir = new File(filename).getAbsoluteFile().getParentFile();
+		try {
+			if (!targetDir.exists()) {
+				if (!targetDir.mkdirs()) {
+					System.out
+							.println("IO ERROR: Creating the directory structure for \""
+									+ filename + "\" failed!");
+				}
+			}
+
+			try {
+				fos = new FileOutputStream(filename);
+				Writer w = new BufferedWriter(new OutputStreamWriter(fos));
+				w.write(content);
+				w.flush();
+				w.close();
+							
+			} catch (FileNotFoundException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		} catch (SecurityException se) {
+			System.out
+					.println("IO ERROR: Could not create ouput files and / or directories!"
+							+ "Caused by: \"" + filename + "\"");
+		}
+
+	}
+
+	public static void streamCopyFile(String sourceFilename, String targetFilename){
+		try {
+			File targetFile = new File(targetFilename);
+			if (!targetFile.getParentFile().exists()){
+				if (!targetFile.getParentFile().mkdirs()){
+					System.out
+					.println("IO ERROR: Creating the directory structure for \""
+							+ targetFilename + "\" failed!");
+				}
+			}
+			FileOutputStream outStream = new FileOutputStream(targetFile);
+			FileInputStream inStream = new FileInputStream(sourceFilename);
+			int c;
+			try {
+				while((c = inStream.read()) != -1){
+					outStream.write(c);
+				}	
+			} catch (IOException e) {
+				System.out.println("IO ERROR: Caused while copying: \""+sourceFilename+"\" to \""+targetFilename+"\"");
+			}
+		} catch (FileNotFoundException e1) {
+			System.out.println("IO ERROR: File not found: \""+sourceFilename+" / "+targetFilename+"\"");
+			e1.printStackTrace();
+		}
+	}
+	
+//	public static String getSubPath(String basePath, String resourcePath) {
+//		String subPath = resourcePath.substring(basePath.length());
+//		return subPath;
+//	}
+	
+	// --------------------------------------------------------------------------
+
+	public static int getLOC(String filename){
+		int LOC = 0;
+		String code = MiscTools.readFile(filename);
+		int index = 0;
+		while (index != -1) {
+			if (index == 0){
+				index = code.indexOf("\n", index);
+			} else {
+				index = code.indexOf("\n", index + 1);
+			}
+			LOC++;
+		}
+		return LOC;
+	}
+
+	// --------------------------------------------------------------------------
+	public static String doubleToString(double d) {
+		DecimalFormat fmt = new DecimalFormat("0.00");
+		String string = fmt.format(d);
+		return string;
+	}
+
+	public static String getSubPath(String inputPath){
+		String subPath = "";
+		File input = new File(getProperInputPath(inputPath));
+		if (input.isFile()){
+			subPath = input.getName().substring(0, input.getName().lastIndexOf("."));
+		} else {
+			subPath = input.getName();
+		}
+		return subPath;
+	}
+
+	public static String getProperOutputPath(String outputDirectory) {
+		String properOutputPath = "";
+		try {
+			//gets the full path if relative path is provided
+			properOutputPath = new File(outputDirectory).getCanonicalPath();
+		} catch (IOException e) {
+			System.out.println("IO ERROR: ");
+			e.printStackTrace();
+		} 
+		return properOutputPath;
+	}
+
+	public static String getProperInputPath(String inputPath) {
+		// strips slash if present
+		//TODO: reorganize and extrarct
+		//TODO: Document "feature" -> if multiple input paths are provided, the first one will be used for the sub path calculation
+		String properInputPath = new File(inputPath).getPath();
+		
+		if (properInputPath.equals(".")) {
+			try {
+				//gets the full path
+				properInputPath = new File(properInputPath).getCanonicalFile()
+						.getName();
+			} catch (IOException e) {
+				System.out.println("IO ERROR: ");
+				e.printStackTrace();
+			}
+		}
+		return properInputPath;
+	}
+
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/WildcardFilter.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/WildcardFilter.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/WildcardFilter.java	(revision 7)
@@ -0,0 +1,32 @@
+package org.etsi.common;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class WildcardFilter implements FileFilter {
+
+	private String wildcardRegExp = "";
+	
+	public WildcardFilter(File wildcardFile){
+		String wildcardRegExp = wildcardFile.getName();
+		wildcardRegExp = wildcardRegExp.replaceAll("\\.", "\\\\.");
+		wildcardRegExp = wildcardRegExp.replaceAll("\\?", ".");
+		wildcardRegExp = wildcardRegExp.replaceAll("\\*", ".*");
+		this.wildcardRegExp = wildcardRegExp;
+	}
+	
+	@Override
+	public boolean accept(File file) {
+		if (file.isFile() || file.isDirectory()){
+			Pattern wildcardPattern = Pattern.compile(this.wildcardRegExp);
+			Matcher wildcardMatcher = wildcardPattern.matcher(file.getName());
+			if (wildcardMatcher.matches()) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/configuration/ConfigTools.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/configuration/ConfigTools.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/configuration/ConfigTools.java	(revision 7)
@@ -0,0 +1,228 @@
+package org.etsi.common.configuration;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+
+import org.etsi.common.MiscTools;
+import org.etsi.common.exceptions.TerminationException;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.converters.ConversionException;
+
+public class ConfigTools {
+	
+	private ToolConfiguration config = null;
+	private String configurationClassName;
+	private String configurationProfileClassName;
+	private String toolVersion;
+	
+	public ConfigTools(String configurationClassName, String configurationProfileClassName) {
+		this.configurationClassName = configurationClassName;
+		this.configurationProfileClassName = configurationProfileClassName;
+	}
+	
+	
+	public void loadConfig(String configurationFilename) throws TerminationException, InstantiationException, IllegalAccessException, ClassNotFoundException {
+		System.out.println("Loading configuration ...");
+		File configFile = new File(configurationFilename);
+		if (configFile.exists()) {
+			config = readConfig(configurationFilename);
+			if (config == null) {
+				System.out.println("ERROR: XML configuration could not be loaded! "
+						+ "\n  Please check the configuration for consistency or use an auto-generated configuration file to migrate any custom settings!");
+				throw new TerminationException("");
+			}
+		} else {
+			System.out.println("ERROR: Configuration file \""+configurationFilename+"\" does not exist! Use the appropriate option to generate a new default configuration.");
+			throw new TerminationException("");
+//			config = initializeNewDefaultConfig(configurationFilename);
+		}
+	}
+
+	public ToolConfiguration initializeNewDefaultConfig(
+			String configurationFilename) throws TerminationException, InstantiationException, IllegalAccessException, ClassNotFoundException {
+		System.out.println("  Generating new default configuration in: \""
+				+ configurationFilename + "\" ...");
+		ToolConfiguration config = null;
+		ConfigurationProfile configurationProfile = null;
+		config = (ToolConfiguration) Class.forName(configurationClassName).newInstance();
+		configurationProfile = (ConfigurationProfile) Class.forName(configurationProfileClassName).newInstance();
+		configurationProfile.setProfileName("defaultProfile");
+		configurationProfile.setProfileVersion(getToolVersion());
+		config.setDefaultConfigurationProfile("all");
+		if (config.getConfigurationProfiles() == null) {
+			ArrayList<ConfigurationProfile> configurationProfiles = new ArrayList<ConfigurationProfile>();
+			config.setConfigurationProfiles(configurationProfiles);
+		}
+		config.getConfigurationProfiles().add(configurationProfile);
+		writeConfig(config, configurationFilename);
+		return config;
+	}	
+
+	// -------------------------------------------------------------------------
+	
+/*	//TO BE DEPRECATED
+	//TODO: Reorganize and reuse 
+	public static String findConfig(String filename) {
+		File configPath = new File(getConfigurationPath());
+		if (configPath.exists()) {
+			File configFile = null;
+			if (filename.length() > 0) {
+				configFile = new File(getConfigurationPath() + filename);
+			} else {
+				configFile = new File(getDefaultConfigurationFilePath());
+			}
+			if (configFile.exists())
+				return configFile.getAbsolutePath();
+			else
+				return null;
+		} else {
+			configPath.mkdir();
+			return null;
+		}
+	}
+	//TODO: TO BE DEPRECATED
+	public static String findConfig() {
+		return findConfig("");
+	}
+	
+	
+	//TODO: TO BE DEPRECATED
+	//TODO: FIX THESE HARDCODED PARTS
+	public static String getConfigurationPath() {
+		if (System.getProperty("os.name").toLowerCase().contains("windows")) {
+			String appdata = System.getenv("appdata");
+			return appdata + "\\T3Q\\";
+		} else { // assume unix
+			String home = System.getProperty("user.home");
+			return home + "/.t3q/";
+		}
+	}
+
+	
+	//TODO: TO BE DEPRECATED
+	public static String getDefaultConfigurationFilePath() {
+		return getConfigurationPath() + "t3q.xml";
+	}
+*/	
+	// -------------------------------------------------------------------------
+	
+	private ToolConfiguration readConfig(String filename) throws TerminationException {
+		System.out.println("  Reading XML configuration from: " + filename);
+		String str = MiscTools.readFile(filename);
+		XStream xstream = new XStream();
+		initXstreamAliases(xstream);
+		ToolConfiguration config = null;
+		try{
+			config = (ToolConfiguration)xstream.fromXML(str);
+		} catch (ConversionException ce){
+			String line = "";
+			line = ce.getMessage().split("line\\snumber[\\t\\s]+?:\\s")[1];
+			line = line.substring(0, line.indexOf("\n"));
+			System.out.println("  Problem Occured while loading configuration: line: "+line);
+			//TODO: add further debugging details?
+		}
+		return config;
+	}
+
+	private void initXstreamAliases(XStream xstream) throws TerminationException {
+		try {
+			xstream.alias(Class.forName(configurationClassName).getSimpleName(), Class.forName(configurationClassName));
+			xstream.alias(Class.forName(configurationProfileClassName).getSimpleName(), Class.forName(configurationProfileClassName));
+		} catch (ClassNotFoundException e) {
+			System.out.println("  Problem occurred while initiating XStream. Class not found: "+e.getMessage());
+			throw new TerminationException("Class not found: "+e.getMessage());
+		}
+	}
+
+	private void writeConfig(ToolConfiguration config, String filename) throws TerminationException {
+		System.out.println("  Writing XML configuration to: "+filename);
+		XStream xstream = new XStream();
+		initXstreamAliases(xstream);
+		String xml = xstream.toXML(config);
+		OutputStreamWriter oos;
+		//write out an empty file
+		MiscTools.writeFile(filename, "");
+		try {
+			oos = new OutputStreamWriter (new FileOutputStream(filename));
+			oos.write(xml);
+			oos.close();
+		} catch (FileNotFoundException e) {
+			System.out.println("  ERROR: File could not be found! (\""+filename+"\")");
+			throw new TerminationException(e.getMessage());
+		} catch (IOException e) {
+			System.out.println("  IO ERROR: Could not write to file! (\""+filename+"\")");
+			throw new TerminationException(e.getMessage());
+		}
+	}
+
+	public ConfigurationProfile selectProfile(String specifiedProfileName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+		// add all default implicit profile
+		ConfigurationProfile selectedProfile = null;
+		ConfigurationProfile allEnabledProfile = (ConfigurationProfile) Class.forName(configurationProfileClassName).newInstance();
+		allEnabledProfile.setProfileName("all");
+		allEnabledProfile.setProfileVersion(getToolVersion());
+		config.getConfigurationProfiles().add(allEnabledProfile);
+		if (specifiedProfileName != null){
+			System.out.println("  Selecting profile \"" + specifiedProfileName
+					+ "\"...");
+			selectedProfile = activateProfile(specifiedProfileName);
+		}
+		if (selectedProfile == null) {
+			if (specifiedProfileName != null) {
+				System.out.println("  Profile \""
+						+ specifiedProfileName
+						+ "\" not found in configuration. Trying default profile \""
+						+ config.getDefaultConfigurationProfile() + "\".");
+			} else {
+				System.out.println("  No Profile specified. Trying default profile \""
+						+ config.getDefaultConfigurationProfile() + "\".");
+			}
+
+			specifiedProfileName = config.getDefaultConfigurationProfile();
+			selectedProfile = activateProfile(specifiedProfileName);
+
+		}
+		if (selectedProfile == null) {
+			System.out.println("  Profile \""
+					+ specifiedProfileName
+					+ "\" not found in configuration. Auto-selecting \"all\" profile.");
+			selectedProfile = allEnabledProfile;
+		}
+		
+		return selectedProfile;
+	}
+
+	// --------------------------------------------------------------------------
+	//TODO: Extract configuration management and possibly abstract it for reusability
+	private ConfigurationProfile activateProfile(String specifiedProfile) {
+		ConfigurationProfile activatedProfile = null;
+		
+		for (int i = 0; i < config.getConfigurationProfiles().size(); i++) {
+			ConfigurationProfile configurationProfile = (ConfigurationProfile) config
+					.getConfigurationProfiles().get(i);
+			if (configurationProfile.getProfileName().toLowerCase().equals(
+					specifiedProfile.toLowerCase())) {
+				System.out.println("  Activating profile \"" + specifiedProfile
+						+ "\"...");
+				activatedProfile = configurationProfile;
+			}
+		}
+		return activatedProfile;
+	}
+
+
+	public void setToolVersion(String toolVersion) {
+		this.toolVersion = toolVersion;
+	}
+
+
+	public String getToolVersion() {
+		return toolVersion;
+	}
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/configuration/ConfigurationProfile.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/configuration/ConfigurationProfile.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/configuration/ConfigurationProfile.java	(revision 7)
@@ -0,0 +1,93 @@
+package org.etsi.common.configuration;
+
+import org.etsi.common.logging.LoggingConfiguration;
+
+public abstract class ConfigurationProfile {
+
+	protected String profileName;
+	protected String profileVersion;
+	protected String resourceExtensionsRegExp = "ttcn|ttcn3|3mp";
+	protected String projectExtension = "t3p";
+	protected boolean settingRecursiveProcessing = true;
+	protected boolean settingAbortOnError = true;
+	protected LoggingConfiguration loggingConfiguration = new LoggingConfiguration();
+	protected boolean statShowSummary = true;
+	protected boolean statShowLOC = true;
+
+	public ConfigurationProfile() {
+		super();
+	}
+
+	public String getProfileName() {
+		return profileName;
+	}
+
+	public void setProfileName(String profileName) {
+		this.profileName = profileName;
+	}
+
+	public void setSettingRecursiveProcessing(boolean settingRecursiveProcessing) {
+		this.settingRecursiveProcessing = settingRecursiveProcessing;
+	}
+
+	public boolean isSettingRecursiveProcessing() {
+		return settingRecursiveProcessing;
+	}
+
+	public void setStatShowLOC(boolean statShowLOC) {
+		this.statShowLOC = statShowLOC;
+	}
+
+	public boolean isStatShowLOC() {
+		return statShowLOC;
+	}
+
+	public void setSettingAbortOnError(boolean settingAbortOnError) {
+		this.settingAbortOnError = settingAbortOnError;
+	}
+
+	public boolean isSettingAbortOnError() {
+		return settingAbortOnError;
+	}
+
+	public void setProfileVersion(String profileVersion) {
+		this.profileVersion = profileVersion;
+	}
+
+	public String getProfileVersion() {
+		return profileVersion;
+	}
+
+	public void setLoggingConfiguration(LoggingConfiguration loggingConfiguration) {
+		this.loggingConfiguration = loggingConfiguration;
+	}
+
+	public LoggingConfiguration getLoggingConfiguration() {
+		return loggingConfiguration;
+	}
+
+	public void setStatShowSummary(boolean statShowSummary) {
+		this.statShowSummary = statShowSummary;
+	}
+
+	public boolean isStatShowSummary() {
+		return statShowSummary;
+	}
+
+	public void setResourceExtensionsRegExp(String resourceExtensionsRegExp) {
+		this.resourceExtensionsRegExp = resourceExtensionsRegExp;
+	}
+
+	public String getResourceExtensionsRegExp() {
+		return resourceExtensionsRegExp;
+	}
+
+	public void setProjectExtension(String projectExtension) {
+		this.projectExtension = projectExtension;
+	}
+
+	public String getProjectExtension() {
+		return projectExtension;
+	}
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/configuration/OptionWithID.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/configuration/OptionWithID.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/configuration/OptionWithID.java	(revision 7)
@@ -0,0 +1,45 @@
+package org.etsi.common.configuration;
+
+import org.apache.commons.cli.Option;
+
+public class OptionWithID extends Option {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -2643329397818768355L;
+	private int id;
+	
+	public OptionWithID(String opt, String longOpt, boolean hasArg,
+			String description) throws IllegalArgumentException {
+		super(opt, longOpt, hasArg, description);
+	}
+
+	public OptionWithID(String longOpt, boolean hasArg,
+			String description) throws IllegalArgumentException {
+		super(null, longOpt, hasArg, description);
+	}
+	
+	public OptionWithID(int id, String longOpt, boolean hasArg,
+			String description) throws IllegalArgumentException {
+		super(null, longOpt, hasArg, description);
+		this.setId(id);
+	}
+	
+	public OptionWithID(int id, String longOpt, 
+			String description) throws IllegalArgumentException {
+		super(null, description);
+		this.setLongOpt(longOpt);
+		this.setId(id);
+	}
+	
+	public void setId(int id) {
+		this.id = id;
+	}
+	
+	public int getId() {
+		return this.id;
+	}
+	
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/configuration/OptionsHandler.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/configuration/OptionsHandler.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/configuration/OptionsHandler.java	(revision 7)
@@ -0,0 +1,56 @@
+package org.etsi.common.configuration;
+
+import org.apache.commons.cli.Options;
+
+public class OptionsHandler {
+
+	private Options options = new Options();
+
+	public OptionsHandler() {
+		this.initialize();
+	}
+
+	private void initialize() {
+		
+		OptionWithID optionWithID;
+
+		optionWithID = new OptionWithID(9, "generate-config", "Generate a new default configuration file at the specified file location");
+		optionWithID.setArgs(1);
+		optionWithID.setArgName("FILE NAME");
+		getOptions().addOption(optionWithID);
+		
+		optionWithID = new OptionWithID(10, "config", "Configuration file location\n");
+		optionWithID.setArgs(1);
+		optionWithID.setArgName("FILE NAME");
+//		optionWithID.setRequired(true);		
+		getOptions().addOption(optionWithID);
+
+		optionWithID = new OptionWithID(20, "profile", "Configuration profile\n");
+		optionWithID.setArgs(1);
+		optionWithID.setArgName("PROFILE NAME");
+		getOptions().addOption(optionWithID);
+
+		optionWithID = new OptionWithID(30, "verbosity", "Verbosity level (currently supports ERROR, WARNING and INFORMATION values)\n");
+		optionWithID.setArgs(1);
+		optionWithID.setArgName("LOG LEVEL");
+		getOptions().addOption(optionWithID);
+
+		optionWithID = new OptionWithID(40, "output-path", "Destination path for the output (if applicable, otherwise ignored). Overrides the profile setting.\n");
+		optionWithID.setArgs(1);
+		optionWithID.setArgName("PATH");
+		getOptions().addOption(optionWithID);
+		
+		optionWithID = new OptionWithID(100, "help", "Show this usage information screen\n");
+		getOptions().addOption(optionWithID);
+	
+	}
+
+	public void setOptions(Options options) {
+		this.options = options;
+	}
+
+	public Options getOptions() {
+		return options;
+	}
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/configuration/ToolConfiguration.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/configuration/ToolConfiguration.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/configuration/ToolConfiguration.java	(revision 7)
@@ -0,0 +1,30 @@
+package org.etsi.common.configuration;
+
+import java.util.ArrayList;
+
+public abstract class ToolConfiguration {
+
+	private ArrayList<ConfigurationProfile> ConfigurationProfiles;
+	private String defaultConfigurationProfile;
+
+	public ToolConfiguration() {
+		super();
+	}
+
+	public ArrayList<ConfigurationProfile> getConfigurationProfiles() {
+		return ConfigurationProfiles;
+	}
+
+	public void setConfigurationProfiles(ArrayList<ConfigurationProfile> configurationProfiles) {
+		this.ConfigurationProfiles = configurationProfiles;
+	}
+
+	public String getDefaultConfigurationProfile() {
+		return defaultConfigurationProfile;
+	}
+
+	public void setDefaultConfigurationProfile(String defaultConfigurationProfile) {
+		this.defaultConfigurationProfile = defaultConfigurationProfile;
+	}
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/exceptions/TerminationException.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/exceptions/TerminationException.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/exceptions/TerminationException.java	(revision 7)
@@ -0,0 +1,13 @@
+package org.etsi.common.exceptions;
+
+public class TerminationException extends Exception {
+
+	private static final long serialVersionUID = -2717985520434639235L;
+
+	public TerminationException(String message) {
+		super("Errors occurred during execution! Could not continue! \n\t" + message);
+		System.err.println(super.getMessage());
+		System.exit(1);
+	}
+
+}
Index: trunk/org.etsi.common/src/org/etsi/common/logging/LogMessage.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/logging/LogMessage.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/logging/LogMessage.java	(revision 7)
@@ -0,0 +1,114 @@
+package org.etsi.common.logging;
+
+import org.etsi.common.logging.LoggingInterface.LogLevel;
+import org.etsi.common.logging.LoggingInterface.MessageClass;
+
+public class LogMessage {
+	private String prefix;
+	private String filename;
+	private int startLine;
+	private int endLine;
+	private LogLevel logLevel;
+	private MessageClass messageClass;
+	private String message;
+	private String details;
+	
+	public LogMessage(){
+		
+	}
+	
+	public LogMessage(String filename, int startLine, int endLine, LogLevel logLevel, MessageClass messageClass, String message, String details){
+		this.setFilename(filename);
+		this.setStartLine(startLine);
+		this.setEndLine(endLine);
+		this.setLogLevel(logLevel);
+		this.setMessageClass(messageClass);
+		this.setMessage(message);
+		this.setDetails(details);
+	}
+	
+	public String toString(){
+		String output = "";
+		output += getPrefix();
+		if (getFilename() != null) {
+			output += getFilename() + ": ";
+		}
+
+		if (getStartLine() >= getEndLine()) {
+			output += getStartLine() + ": ";
+		} else {
+			output += getStartLine() + "-" + getEndLine() + ": ";
+		}
+
+		output += getLogLevel() + ": ";
+
+		if (getMessageClass() != null) {
+			output += getMessageClass().getDescription() + ": ";
+		}
+
+		output += getMessage();
+
+		if (getDetails() != null) {
+			output += " (" + getDetails() + ")";
+		}
+
+		return output;
+	}
+	
+	
+	public int getStartLine() {
+		return startLine;
+	}
+	public void setStartLine(int startLine) {
+		this.startLine = startLine;
+	}
+	public int getEndLine() {
+		return endLine;
+	}
+	public void setEndLine(int endLine) {
+		this.endLine = endLine;
+	}
+	public LogLevel getLogLevel() {
+		return logLevel;
+	}
+	public void setLogLevel(LogLevel logLevel) {
+		this.logLevel = logLevel;
+	}
+	public MessageClass getMessageClass() {
+		return messageClass;
+	}
+	public void setMessageClass(MessageClass messageClass) {
+		this.messageClass = messageClass;
+	}
+	public String getMessage() {
+		return message;
+	}
+	public void setMessage(String message) {
+		this.message = message;
+	}
+	public String getDetails() {
+		return details;
+	}
+	public void setDetails(String details) {
+		this.details = details;
+	}
+
+
+	public void setFilename(String filename) {
+		this.filename = filename;
+	}
+
+
+	public String getFilename() {
+		return filename;
+	}
+
+	public void setPrefix(String prefix) {
+		this.prefix = prefix;
+	}
+
+	public String getPrefix() {
+		return prefix;
+	}
+	
+}
Index: trunk/org.etsi.common/src/org/etsi/common/logging/LoggingConfiguration.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/logging/LoggingConfiguration.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/logging/LoggingConfiguration.java	(revision 7)
@@ -0,0 +1,41 @@
+package org.etsi.common.logging;
+
+public class LoggingConfiguration {
+	private boolean showFullPath = false;
+	private boolean showFilename = true;
+	private boolean showMessageClass = true;
+	private boolean showDetails = true;
+	private String logOutputPrefix = "   ";
+	
+	public boolean isShowFullPath() {
+		return showFullPath;
+	}
+	public void setShowFullPath(boolean showFullPath) {
+		this.showFullPath = showFullPath;
+	}
+	public boolean isShowFilename() {
+		return showFilename;
+	}
+	public void setShowFilename(boolean showFilename) {
+		this.showFilename = showFilename;
+	}
+	public boolean isShowMessageClass() {
+		return showMessageClass;
+	}
+	public void setShowMessageClass(boolean showMessageClass) {
+		this.showMessageClass = showMessageClass;
+	}
+	public boolean isShowDetails() {
+		return showDetails;
+	}
+	public void setShowDetails(boolean showDetails) {
+		this.showDetails = showDetails;
+	}
+	public void setLogOutputPrefix(String logOutputPrefix) {
+		this.logOutputPrefix = logOutputPrefix;
+	}
+	public String getLogOutputPrefix() {
+		return logOutputPrefix;
+	}
+	
+}
Index: trunk/org.etsi.common/src/org/etsi/common/logging/LoggingInterface.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/logging/LoggingInterface.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/logging/LoggingInterface.java	(revision 7)
@@ -0,0 +1,291 @@
+package org.etsi.common.logging;
+
+
+import org.etsi.common.MiscTools;
+
+public class LoggingInterface {
+	
+	public enum LogLevel {
+		//ORDER MATTERS
+		ERROR,
+		WARNING,
+		INFORMATION,
+		FIXME,
+		DEBUG;
+	}
+
+	public enum MessageClass {
+		//ORDER MATTERS
+		UNIVERSAL ("Universal", 0),
+		GENERAL ("General", 1),
+		NAMING ("Naming Conventions", 2),
+		DOCUMENTATION ("Code Documentation", 3),
+		LOGGING ("Log Statements", 4),
+		STRUCTURE ("Structure of Data", 5), 
+		STYLE ("Code Style", 6),
+		MODULARIZATION ("Test Suite Modularization", 7);
+		
+		private final String description;
+		private final int id;
+		private int occurenceCount = 0;
+		
+		MessageClass (String description, int id){
+			this.description = description;
+			this.id = id;
+		}
+
+		public String getDescription() {
+			return description;
+		}
+
+		public int getId() {
+			return id;
+		}
+
+		public void addOccurence() {
+			this.occurenceCount++;
+		}
+
+		public int getOccurenceCount() {
+			return occurenceCount;
+		}
+	}
+	
+	private String logSourceName = "";
+	private LogLevel maximumLogLevel = LogLevel.INFORMATION;
+	private LogLevel defaultLogLevel = LogLevel.INFORMATION;
+	private LoggingConfiguration configuration = new LoggingConfiguration();
+	
+	public LoggingInterface(LoggingConfiguration logConfiguration) {
+		this.setConfiguration(logConfiguration);
+	}
+	
+	public LoggingInterface(String logSourceName, LoggingConfiguration logConfiguration){
+		this(logConfiguration);
+		this.setLogSourceName(logSourceName);
+	}
+	public LoggingInterface(String logSourceName, LoggingConfiguration logConfiguration, LogLevel maximumLogLevel){
+		this(logSourceName, logConfiguration);
+		this.setMaximumLogLevel(maximumLogLevel);
+	}
+	
+	private LogMessage createLogMessage(LogLevel l, int startLine, int endLine, MessageClass messageClass, String message, String details){
+		LogMessage logMessage = new LogMessage();
+		logMessage.setPrefix(this.getConfiguration().getLogOutputPrefix());
+
+		if (this.getConfiguration().isShowFullPath()) {
+			logMessage.setFilename(this.getLogSourceName());
+		} else {
+			if (this.getConfiguration().isShowFilename()) {
+				logMessage.setFilename(MiscTools.getShortFilename(this
+						.getLogSourceName()));
+			}
+		}
+		logMessage.setStartLine(startLine);
+		logMessage.setEndLine(endLine);
+		logMessage.setLogLevel(l);
+		
+		messageClass.addOccurence();
+		
+		if (this.getConfiguration().isShowMessageClass()) {
+			logMessage.setMessageClass(messageClass);
+		} else {
+			logMessage.setMessageClass(null);
+		}
+		
+		logMessage.setMessage(message);
+
+		if (this.getConfiguration().isShowDetails() && details != null) {
+			logMessage.setDetails(details);
+		} else {
+			logMessage.setDetails(null);
+		}
+		
+		return logMessage;
+	}
+	
+/*	private String composeLogMessage(LogLevel l, int startLine, int endLine, MessageClass messageClass, String message, String details){
+		String composedLogMessage = "";
+
+		composedLogMessage += this.getConfiguration().getLogOutputPrefix();
+
+		if (this.getConfiguration().isShowFullPath()) {
+			composedLogMessage += this.getLogSourceName() + ": ";
+		} else {
+			if (this.getConfiguration().isShowFilename()) {
+				composedLogMessage += MiscTools.getShortFilename(this
+						.getLogSourceName())
+						+ ": ";
+			}
+		}
+
+		if (startLine >= endLine) {
+			composedLogMessage += startLine + ": ";
+		} else {
+			composedLogMessage += startLine + "-" + endLine + ": ";
+		}
+
+		composedLogMessage += l + ": ";
+
+		if (this.getConfiguration().isShowMessageClass()) {
+			composedLogMessage += messageClass.getDescription() + ": ";
+		}
+
+		composedLogMessage += message;
+
+		if (this.getConfiguration().isShowDetails() && details != null) {
+			composedLogMessage += "(" + details + ")";
+		}
+
+		return composedLogMessage;
+	}
+*/
+
+	public void logMessage(LogLevel l, int startLine, int endLine, MessageClass messageClass, String message, String details){
+		if (showLogLevel(l)){
+			LogMessage composedLogMessage = createLogMessage(l, startLine, endLine, messageClass, message, details);
+			outputLog(composedLogMessage);
+		}
+	}
+	
+	public void logMessage(LogLevel l, int startLine, int endLine, MessageClass messageClass, String message){
+		if (showLogLevel(l)){
+			LogMessage composedLogMessage = createLogMessage(l, startLine, endLine, messageClass, message, null);
+			outputLog(composedLogMessage);
+		}
+	}
+
+	public void logMessage(int startLine, int endLine, MessageClass messageClass, String message, String details){
+		if (showLogLevel(this.getDefaultLogLevel())){
+			LogMessage composedLogMessage = createLogMessage(this.getDefaultLogLevel(), startLine, endLine, messageClass, message, details);
+			outputLog(composedLogMessage);
+		}
+	}
+
+	
+	public void logMessage(int startLine, int endLine, MessageClass messageClass, String message){
+		if (showLogLevel(this.getDefaultLogLevel())){
+			LogMessage composedLogMessage = createLogMessage(this.getDefaultLogLevel(), startLine, endLine, messageClass, message, null);
+			outputLog(composedLogMessage);
+		}
+	}
+
+	
+//	private void outputLog(String composedLogMessage){
+//		System.out.println(composedLogMessage);
+//	}
+
+	private void outputLog(LogMessage composedLogMessage){
+		System.out.println(composedLogMessage.toString());
+	}
+
+	public void logWarning(int startLine, int endLine, MessageClass messageClass, String message){
+		if (showLogLevel(LogLevel.WARNING)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.WARNING, startLine, endLine, messageClass, message, null);
+			outputLog(composedLogMessage);
+		}
+	}
+
+	public void logWarning(int startLine, int endLine, MessageClass messageClass, String message, String details){
+		if (showLogLevel(LogLevel.WARNING)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.WARNING, startLine, endLine, messageClass, message, details);
+			outputLog(composedLogMessage);
+		}
+		
+	}
+	
+	public void logDebug(int startLine, int endLine, MessageClass messageClass, String message){
+		if (showLogLevel(LogLevel.DEBUG)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.DEBUG, startLine, endLine, messageClass, message, null);
+			outputLog(composedLogMessage);
+		}
+		
+	}
+	
+	public void logDebug(int startLine, int endLine, MessageClass messageClass, String message, String details){
+		if (showLogLevel(LogLevel.DEBUG)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.DEBUG, startLine, endLine, messageClass, message, details);
+			outputLog(composedLogMessage);
+		}
+		
+	}
+
+	public void logFix(int startLine, int endLine, MessageClass messageClass, String message){
+		if (showLogLevel(LogLevel.FIXME)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.FIXME, startLine, endLine, messageClass, message, null);
+			outputLog(composedLogMessage);
+		}
+		
+	}
+	
+	public void logFix(int startLine, int endLine, MessageClass messageClass, String message, String details){
+		if (showLogLevel(LogLevel.FIXME)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.FIXME, startLine, endLine, messageClass, message, details);
+			outputLog(composedLogMessage);
+		}
+		
+	}
+
+	
+	public void logError(int startLine, int endLine, MessageClass messageClass, String message){
+		if (showLogLevel(LogLevel.ERROR)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.ERROR, startLine, endLine, messageClass, message, null);
+			outputLog(composedLogMessage);
+		}
+	}
+	
+	public void logInformation(int startLine, int endLine, MessageClass messageClass, String message){
+		if (showLogLevel(LogLevel.INFORMATION)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.INFORMATION, startLine, endLine, messageClass, message, null);
+			outputLog(composedLogMessage);
+		}
+	}
+
+	public void logInformation(int startLine, int endLine, MessageClass messageClass, String message, String detail){
+		if (showLogLevel(LogLevel.INFORMATION)){
+			LogMessage composedLogMessage = createLogMessage(LogLevel.INFORMATION, startLine, endLine, messageClass, message, detail);
+			outputLog(composedLogMessage);
+		}
+	}
+
+	
+	public String getLogSourceName() {
+		return logSourceName;
+	}
+	
+		
+	public void setMaximumLogLevel(LogLevel maximumLogLevel) {
+		this.maximumLogLevel = maximumLogLevel;
+	}
+	
+	public LogLevel getMaximumLogLevel() {
+		return maximumLogLevel;
+	}
+
+	public boolean showLogLevel(LogLevel logLevel) {
+		boolean show = false;
+		if (logLevel.ordinal() <= this.getMaximumLogLevel().ordinal()){
+			show = true;
+		}
+		return show;
+	}
+
+	public void setConfiguration(LoggingConfiguration configuration) {
+		this.configuration = configuration;
+	}
+	public LoggingConfiguration getConfiguration() {
+		return configuration;
+	}
+	public void setDefaultLogLevel(LogLevel defaultLogLevel) {
+		this.defaultLogLevel = defaultLogLevel;
+	}
+	public LogLevel getDefaultLogLevel() {
+		return defaultLogLevel;
+	}
+	public void setLogSourceName(String logSourceName) {
+		this.logSourceName = logSourceName;
+	}
+
+
+	
+}
Index: trunk/org.etsi.common/src/org/etsi/common/logging/LoggingStatistics.java
===================================================================
--- trunk/org.etsi.common/src/org/etsi/common/logging/LoggingStatistics.java	(revision 7)
+++ trunk/org.etsi.common/src/org/etsi/common/logging/LoggingStatistics.java	(revision 7)
@@ -0,0 +1,25 @@
+package org.etsi.common.logging;
+
+import java.util.HashMap;
+
+import org.etsi.common.logging.LoggingInterface.MessageClass;
+
+
+//TODO: currently not in use
+public class LoggingStatistics {
+	private HashMap<MessageClass, Integer> statsMap = new HashMap<MessageClass, Integer>();
+	
+	public LoggingStatistics(){
+		for (MessageClass c : MessageClass.values()){
+			this.statsMap.put(c, 0);
+		}
+	}
+	
+	public void addOccurence(MessageClass c){
+		this.statsMap.put(c, this.statsMap.get(c) + 1);
+	}
+	
+	public int getOccurences(MessageClass c){
+		return this.statsMap.get(c);
+	}
+}
