Index: tmp/org.txm.utils/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.utils/META-INF/MANIFEST.MF	(revision 295)
+++ tmp/org.txm.utils/META-INF/MANIFEST.MF	(revision 296)
@@ -4,20 +4,19 @@
 Bundle-SymbolicName: org.txm.utils
 Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.txm.utils.Activator
-Require-Bundle: org.txm.core;bundle-version="0.7.0",
+Require-Bundle: org.eclipse.osgi.util;bundle-version="3.3.0";visibility:=reexport,
+ org.eclipse.core.runtime,
  org.txm.libs.saxon;bundle-version="9.0.0";visibility:=reexport,
- org.eclipse.ui,
- org.eclipse.core.runtime,
  org.eclipse.core.net;bundle-version="1.2.200"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.apache.commons.cli,
- org.apache.commons.io,
- org.apache.commons.io.comparator,
- org.apache.commons.io.filefilter,
+ org.apache.commons.io;uses:="org.apache.commons.io.filefilter",
+ org.apache.commons.io.comparator;uses:="org.apache.commons.io",
+ org.apache.commons.io.filefilter;uses:="org.apache.commons.io",
  org.apache.commons.io.input,
  org.apache.commons.io.output,
- org.apache.commons.lang,
+ org.apache.commons.lang;uses:="org.apache.commons.lang.exception",
  org.apache.commons.lang.builder,
  org.apache.commons.lang.enum,
  org.apache.commons.lang.enums,
@@ -26,52 +25,128 @@
  org.apache.commons.lang.mutable,
  org.apache.commons.lang.text,
  org.apache.commons.lang.time,
- org.apache.tools.ant,
- org.apache.tools.ant.dispatch,
- org.apache.tools.ant.filters,
- org.apache.tools.ant.filters.util,
- org.apache.tools.ant.helper,
+ org.apache.tools.ant;
+  uses:="org.apache.tools.ant.input,
+   org.apache.tools.ant.launch,
+   org.apache.tools.ant.types,
+   new org.apache.tools.ant,
+   org.apache.tools.ant.types.selectors,
+   org.xml.sax",
+ org.apache.tools.ant.dispatch;uses:="org.apache.tools.ant",
+ org.apache.tools.ant.filters;uses:="org.apache.tools.ant.util,org.apache.tools.ant.types,org.apache.tools.ant",
+ org.apache.tools.ant.filters.util;uses:="org.apache.tools.ant",
+ org.apache.tools.ant.helper;
+  uses:="org.apache.tools.ant.util,
+   org.apache.tools.ant,
+   org.xml.sax.helpers,
+   org.xml.sax",
  org.apache.tools.ant.input,
- org.apache.tools.ant.listener,
- org.apache.tools.ant.loader,
- org.apache.tools.ant.taskdefs,
- org.apache.tools.ant.taskdefs.compilers,
- org.apache.tools.ant.taskdefs.condition,
- org.apache.tools.ant.taskdefs.cvslib,
- org.apache.tools.ant.taskdefs.email,
- org.apache.tools.ant.taskdefs.rmic,
- org.apache.tools.ant.types,
- org.apache.tools.ant.types.mappers,
- org.apache.tools.ant.types.resources,
- org.apache.tools.ant.types.resources.comparators,
- org.apache.tools.ant.types.resources.selectors,
- org.apache.tools.ant.types.selectors,
- org.apache.tools.ant.types.selectors.modifiedselector,
- org.apache.tools.ant.types.spi,
- org.apache.tools.ant.util,
- org.apache.tools.ant.util.facade,
- org.apache.tools.ant.util.regexp,
+ org.apache.tools.ant.listener;uses:="org.apache.tools.ant",
+ org.apache.tools.ant.loader;uses:="org.apache.tools.ant",
+ org.apache.tools.ant.taskdefs;
+  uses:="org.apache.tools.ant.util.facade,
+   org.apache.tools.ant.input,
+   org.apache.tools.tar,
+   org.apache.tools.ant.types.selectors.modifiedselector,
+   org.apache.tools.zip,
+   org.apache.tools.ant.types.spi,
+   org.apache.tools.ant,
+   org.apache.tools.ant.types.selectors,
+   org.w3c.dom,
+   org.xml.sax,
+   org.apache.tools.ant.types.resources.selectors,
+   org.apache.tools.ant.types.resources,
+   org.apache.tools.ant.util,
+   org.apache.tools.ant.filters,
+   org.apache.tools.ant.taskdefs.condition,
+   org.apache.tools.ant.taskdefs.email,
+   org.apache.tools.ant.types",
+ org.apache.tools.ant.taskdefs.compilers;uses:="org.apache.tools.ant.types,org.apache.tools.ant.taskdefs,org.apache.tools.ant",
+ org.apache.tools.ant.taskdefs.condition;
+  uses:="org.apache.tools.ant.types,
+   org.apache.tools.ant.taskdefs,
+   org.apache.tools.ant.types.selectors,
+   org.apache.tools.ant",
+ org.apache.tools.ant.taskdefs.cvslib;uses:="org.apache.tools.ant.util,org.apache.tools.ant.taskdefs,org.apache.tools.ant.types",
+ org.apache.tools.ant.taskdefs.email;uses:="org.apache.tools.ant.types,org.apache.tools.ant",
+ org.apache.tools.ant.taskdefs.rmic;
+  uses:="org.apache.tools.ant.util,
+   org.apache.tools.ant.types,
+   org.apache.tools.ant.taskdefs,
+   org.apache.tools.ant",
+ org.apache.tools.ant.types;
+  uses:="org.apache.tools.ant.types.selectors.modifiedselector,
+   org.apache.tools.ant.taskdefs,
+   org.apache.tools.ant,
+   org.apache.tools.ant.types.selectors,
+   org.xml.sax,
+   org.apache.tools.ant.util,
+   javax.xml.transform,
+   org.apache.tools.ant.filters,
+   org.apache.tools.ant.util.regexp",
+ org.apache.tools.ant.types.mappers;uses:="org.apache.tools.ant.util,org.apache.tools.ant.types",
+ org.apache.tools.ant.types.resources;
+  uses:="org.apache.tools.tar,
+   org.apache.tools.ant.types.resources.selectors,
+   org.apache.tools.ant.util,
+   org.apache.tools.zip,
+   org.apache.tools.ant.types.resources.comparators,
+   org.apache.tools.ant.types,
+   org.apache.tools.ant.types.selectors,
+   org.apache.tools.ant",
+ org.apache.tools.ant.types.resources.comparators;uses:="org.apache.tools.ant.types,org.apache.tools.ant",
+ org.apache.tools.ant.types.resources.selectors;uses:="org.apache.tools.ant.types.resources.comparators,org.apache.tools.ant.types,org.apache.tools.ant",
+ org.apache.tools.ant.types.selectors;
+  uses:="org.apache.tools.ant.types.resources.selectors,
+   org.apache.tools.ant.util,
+   org.apache.tools.ant.types.selectors.modifiedselector,
+   org.apache.tools.ant.types,
+   org.apache.tools.ant",
+ org.apache.tools.ant.types.selectors.modifiedselector;
+  uses:="org.apache.tools.ant.types.resources.selectors,
+   org.apache.tools.ant.types,
+   org.apache.tools.ant.types.selectors,
+   org.apache.tools.ant",
+ org.apache.tools.ant.types.spi;uses:="org.apache.tools.ant",
+ org.apache.tools.ant.util;
+  uses:="javax.xml.parsers,
+   org.apache.tools.ant,
+   org.w3c.dom,
+   org.xml.sax,
+   org.apache.tools.ant.types.resources,
+   org.apache.tools.ant.types.resources.selectors,
+   org.apache.tools.ant.types,
+   org.apache.tools.ant.util.regexp",
+ org.apache.tools.ant.util.facade;uses:="org.apache.tools.ant.types",
+ org.apache.tools.ant.util.regexp;uses:="org.apache.tools.ant",
  org.apache.tools.bzip2,
  org.apache.tools.mail,
  org.apache.tools.tar,
  org.apache.tools.zip,
  org.knallgrau.utils.textcat,
  org.mozilla.universalchardet,
- org.mozilla.universalchardet.prober,
+ org.mozilla.universalchardet.prober;uses:="org.mozilla.universalchardet.prober.sequence",
  org.mozilla.universalchardet.prober.contextanalysis,
  org.mozilla.universalchardet.prober.distributionanalysis,
  org.mozilla.universalchardet.prober.sequence,
  org.mozilla.universalchardet.prober.statemachine,
  org.txm.functions,
- org.txm.utils,
+ org.txm.utils;
+  uses:="org.eclipse.core.runtime,
+   org.osgi.framework,
+   org.knallgrau.utils.textcat,
+   org.xml.sax",
  org.txm.utils.i18n,
+ org.txm.utils.io,
  org.txm.utils.logger,
- org.txm.utils.processbuilder,
- org.txm.utils.saxon,
+ org.txm.utils.messages;uses:="org.eclipse.osgi.util",
+ org.txm.utils.network,
+ org.txm.utils.processbuilder;uses:="org.w3c.dom",
+ org.txm.utils.saxon;uses:="net.sf.saxon.value,net.sf.saxon.om,net.sf.saxon.lib",
  org.txm.utils.tostring,
- org.txm.utils.treetagger,
- org.txm.utils.xml,
- org.txm.utils.zip
+ org.txm.utils.treetagger;uses:="org.w3c.dom",
+ org.txm.utils.xml;uses:="org.w3c.dom",
+ org.txm.utils.zip;uses:="org.txm.functions"
 Bundle-ClassPath: .,
  commons-cli-1.2.jar,
  commons-io-1.4.jar,
@@ -79,3 +154,4 @@
  juniversalchardet-1.0.3.jar,
  ant-1.7.1.jar,
  textcat-1.0.1.jar
+Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.utils/src/org/txm/utils/SystemProxyDetector.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/SystemProxyDetector.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/SystemProxyDetector.java	(revision 296)
@@ -1,149 +0,0 @@
-package org.txm.utils;
-
-import java.net.InetSocketAddress;
-import java.net.Proxy;
-import java.net.ProxySelector;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.List;
-
-import org.eclipse.core.net.proxy.IProxyService;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.util.tracker.ServiceTracker;
-import org.txm.utils.logger.Log;
-
-/**
- * This class implements various manner to retrieve the system proxy configuration.
- * It tries to get the configuration from the RCP store and from the Java system properties. 
- * 
- * @author mdecorde, sjacquot
- *
- */
-public class SystemProxyDetector {
-	
-	public String proxy_user = "";
-	public String proxy_password = "";
-	public String proxy_host = "";
-	public int proxy_port = 0;
-
-
-	/**
-	 * Creates a system proxy detector and tries to retrieve the system proxy configuration from  the RCP store and from the Java system properties.
-	 */
-	@SuppressWarnings({ "rawtypes", "unchecked" })
-	public SystemProxyDetector() {
-		ServiceTracker proxyTracker = null;
-		try {
-			Bundle c = FrameworkUtil.getBundle(this.getClass());
-			if (c == null) return; // abord;
-			BundleContext bc = c.getBundleContext();
-			if (bc == null) return; // abord;
-			proxyTracker = new ServiceTracker(bc, IProxyService.class.getName(), null);
-			proxyTracker.open();
-
-			IProxyService proxyService = (IProxyService)proxyTracker.getService();
-			if (proxyService.hasSystemProxies()) { // Always response false for Mac OS X, because there is no Eclipse plugin that manages the system proxies
-				try {
-					List<Proxy> proxies = ProxySelector.getDefault().select(new URI("http://textometrie.ens-lyon.fr"));
-					if (proxies != null) {
-						for (Proxy proxy : proxies) {
-							if (proxy.type().equals(Proxy.Type.HTTP)) {
-								InetSocketAddress addr = (InetSocketAddress) proxy.address();
-								if(addr != null) {
-									proxy_host = addr.getHostName();
-									proxy_port = addr.getPort();
-									break; // ok done
-								}
-							}
-						}
-					} 
-				} catch(URISyntaxException e) {
-					Log.printStackTrace(e);
-				}
-			}
-			
-			// last resort to find out proxy configuration
-			if (proxy_host == null || proxy_host.length() == 0) { 
-				proxy_host = System.getProperty("http.proxyHost");
-				String s = System.getProperty("http.proxyPort");
-				if (s != null) proxy_port =  Integer.parseInt(s);
-				proxy_password = System.getProperty("http.proxyPassword");
-				proxy_user = System.getProperty("http.proxyUser");
-			}
-			
-			
-			// Log
-			if(proxy_host != null && !proxy_host.isEmpty())	{
-				Log.info("System proxy network configuration detected.");
-			}
-			
-			// TODO: useless ?
-//			if (proxyTracker == null) {
-//				IProxyData[] data = proxyService.getProxyData();
-//				for (IProxyData d : data) {
-//					proxy_host = d.getHost();
-//					if (IProxyData.HTTP_PROXY_TYPE.equals(d.getType()) && proxy_host != null && proxy_host.length() > 0) {
-//						proxy_port = d.getPort();
-//						proxy_password = d.getPassword();
-//						proxy_user = d.getUserId();
-//						//System.out.println("proxy_server="+proxy_server+" proxy_port="+proxy_port);
-//						
-//						 break; // ok done
-//					} else {
-//						proxy_host = null;
-//					}
-//				}
-//			}
-		} catch (Exception e) {
-			Log.printStackTrace(e);
-		} finally {
-			if (proxyTracker != null) proxyTracker.close();
-		}
-	}
-
-	/**
-	 * Checks if a system proxy has been detected.
-	 * @return
-	 */
-	public boolean isSystemProxyDetected() {
-		return proxy_host != null && !proxy_host.isEmpty();
-	}
-
-
-	/**
-	 * Returns the HTTP system proxy configuration as URL if exists otherwise false.
-	 * @return
-	 */
-	public String getHttpProxyUrl() {
-		
-		String proxyUrl = null;
-		String userData = "";
-		
-		if(this.isSystemProxyDetected())	{
-			proxyUrl = proxy_host + ":" + proxy_port;
-			
-			if (proxy_user != null && !proxy_user.isEmpty()) {
-				userData = proxy_user;
-				proxyUrl = "@" + proxyUrl; //$NON-NLS-1$
-			}
-			if (proxy_password != null && !proxy_password.isEmpty()) {
-				userData += ":" + proxy_password; //$NON-NLS-1$
-			}
-		}
-		else	{
-			Log.warning("HTTP system proxy configuration is not set.");
-		}
-		
-		if(proxyUrl != null)	{
-			proxyUrl = "http://" + userData + proxyUrl; //$NON-NLS-1$
-		}
-		
-		return proxyUrl;
-	}
-
-	public String toString() {
-		return getHttpProxyUrl();
-	}
-}
Index: tmp/org.txm.utils/src/org/txm/utils/FileCopy.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/FileCopy.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/FileCopy.java	(revision 296)
@@ -1,206 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-// 
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-// 
-// 
-// 
-// $LastChangedDate: 2016-11-17 17:01:31 +0100 (Thu, 17 Nov 2016) $
-// $LastChangedRevision: 3341 $
-// $LastChangedBy: mdecorde $ 
-//
-package org.txm.utils;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel;
-
-import org.txm.core.messages.TXMCoreMessages;
-
-/**
- * File copy methods
- */
-public class FileCopy {
-
-	private static final boolean isWindows = System.getProperty("os.name").contains("Windows");
-	
-	/**
-	 * replace the file if it exists
-	 * 
-	 * @param source
-	 * @param dest
-	 * @return
-	 * @throws IOException
-	 */
-	public static boolean copy(File source, File dest) throws IOException {
-		return copy(source, dest, true);
-	}
-	
-	
-	/**
-	 * copy one file with nio package to accelerate the copy 
-	 * 
-	 * !!! on windows : max size = 64mo !!!.
-	 *
-	 * @param source the source
-	 * @param dest the dest
-	 * @return true, if successful
-	 * @throws IOException Signals that an I/O exception has occurred.
-	 */
-	public static boolean copy(File source, File dest, boolean replace) throws IOException {
-		if (dest.exists() && !replace) return true; // don't replace file
-		
-		if (isWindows || source.length() >= Integer.MAX_VALUE) {
-			//System.out.println("COPY BIG FILE");
-			FileInputStream instream = null;
-			BufferedOutputStream outstream = null;
-			try {
-				//Open a stream of bytes to read the file bytes into the program
-				instream = new FileInputStream(source);
-				//A stream of bytes from the program to the destination
-				outstream = new BufferedOutputStream(new FileOutputStream(dest));
-				byte[] buffer = new byte[4096];
-				int bytesRead;
-				//Write the bytes from the inputstream to the outputstream
-				while((bytesRead = instream.read(buffer))!=-1) {
-					outstream.write(buffer, 0, bytesRead);
-				}
-			} catch (Exception e) {org.txm.utils.logger.Log.printStackTrace(e); return false; 
-			} finally {
-				instream.close();
-				outstream.close();
-				instream = null;
-				outstream = null;
-			}
-		} else {
-			//System.out.println("COPY NORMAL FILE");
-			FileChannel in = null, out = null;
-			FileInputStream fis = null;
-			FileOutputStream fos = null;
-			try {
-				fis = new FileInputStream(source);
-				fos = new FileOutputStream(dest);
-				in = fis.getChannel();
-				out = fos.getChannel();
-
-				long size = in.size();
-				MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, size);
-				
-				out.write(buf);
-			} catch(Exception e) {
-				org.txm.utils.logger.Log.printStackTrace(e);
-				
-				if (fis != null) fis.close();
-				if (fos != null) fos.close();
-				if (in != null)	in.close();
-				if (out != null) out.close();
-				
-				return false;
-			} finally {
-				if (fis != null) fis.close();
-				if (fos != null) fos.close();
-				if (in != null)	in.close();
-				if (out != null) out.close();
-			}
-		}
-		return true;
-	}
-
-	/**
-	 * Copy files. Don't erase the destination directory and replace files if they already exists
-	 *
-	 * @param src the src directory
-	 * @param dest the dest directory
-	 * @throws IOException Signals that an I/O exception has occurred.
-	 */
-	public static void copyFiles(File src, File dest) throws IOException {
-
-		// Check to ensure that the source is valid...
-		if (!src.exists()) {
-			throw new IOException(TXMCoreMessages.FileCopy_0 + src.getAbsolutePath()
-					+ "."); //$NON-NLS-1$ 
-		} else if (!src.canRead()) { // check to ensure we have rights to the
-			// source...
-			throw new IOException(TXMCoreMessages.FileCopy_2 + src.getAbsolutePath()
-					+ "."); //$NON-NLS-1$ 
-		}
-		
-		// is it a directory ?
-		if (src.isDirectory()) {
-			if (!dest.exists()) { // does the destination already exist?
-				// if not create the file hierarchy
-				if (!dest.mkdirs()) {
-					throw new IOException(TXMCoreMessages.FileCopy_4
-							+ dest.getAbsolutePath() + "."); //$NON-NLS-1$ 
-				}
-			}
-
-			// get a listing of files...
-			String list[] = src.list();
-			// copy all the files in the list.
-			for (int i = 0; i < list.length; i++) {
-				File dest1 = new File(dest, list[i]);
-				File src1 = new File(src, list[i]);
-				copyFiles(src1, dest1);
-
-			}
-		} else {
-			// This was not a directory, so lets just copy the file
-			copy(src, dest);
-		}
-	}
-
-	public static void main(String[] args) throws IOException {
-//		File test1 = File.createTempFile("source", ".large"); //$NON-NLS-1$ //$NON-NLS-2$
-//		File test2 = File.createTempFile("source", ".verylarge"); //$NON-NLS-1$ //$NON-NLS-2$
-//		
-//		System.out.println("write "+test1); //$NON-NLS-1$
-//		writeBigFile(test1, Integer.MAX_VALUE / 2, 1);
-//		System.out.println("write "+test2); //$NON-NLS-1$
-//		writeBigFile(test2, Integer.MAX_VALUE / 2, 3);
-//		
-//		System.out.println("test1: "+test1+" : "+test1.length()); //$NON-NLS-1$ //$NON-NLS-2$
-//		System.out.println("test2: "+test2+" : "+test2.length()); //$NON-NLS-1$ //$NON-NLS-2$
-//		
-//		File copy1 = File.createTempFile("copy", ".large"); //$NON-NLS-1$ //$NON-NLS-2$
-//		File copy2 = File.createTempFile("copy", ".verylarge"); //$NON-NLS-1$ //$NON-NLS-2$
-//		
-//		System.out.println("Copy1 "+copy1); //$NON-NLS-1$
-//		FileCopy.copy(test1, copy1);
-//		System.out.println("Copy2 "+copy2); //$NON-NLS-1$
-//		FileCopy.copy(test2, copy2);
-//		
-//		System.out.println("copy1: "+copy1+" : "+copy1.length()); //$NON-NLS-1$ //$NON-NLS-2$
-//		System.out.println("copy2: "+copy2+" : "+copy2.length()); //$NON-NLS-1$ //$NON-NLS-2$
-//		
-//		System.out.println("delete 1 "+test1.delete()); //$NON-NLS-1$
-//		System.out.println("delete 2 "+test2.delete()); //$NON-NLS-1$
-//		System.out.println("delete c1 "+copy1.delete()); //$NON-NLS-1$
-//		System.out.println("delete c2 "+copy2.delete()); //$NON-NLS-1$
-		
-		File dir1 = new File("/home/mdecorde/TEMP/copy1");
-		File dir2 = new File("/home/mdecorde/TEMP/copy2");
-		FileCopy.copyFiles(dir1, dir2);
-	}
-}
-
Index: tmp/org.txm.utils/src/org/txm/utils/IOUtils.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/IOUtils.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/IOUtils.java	(revision 296)
@@ -1,82 +0,0 @@
-package org.txm.utils;
-
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-
-import org.txm.utils.i18n.DetectBOM;
-
-public class IOUtils {
-	public static final String UTF8 = "UTF-8";
-
-	public static BufferedReader getReader(File file) throws UnsupportedEncodingException, FileNotFoundException {
-		return getReader(file, UTF8);
-	}
-
-	public static BufferedReader getReader(File file, String encoding) throws UnsupportedEncodingException, FileNotFoundException {
-		FileInputStream input = new FileInputStream(file);
-		DetectBOM db = new DetectBOM(file);
-		for (int ibom = 0 ; ibom < db.getBOMSize() ; ibom++)
-			try {
-				input.read();
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-		return new BufferedReader(new InputStreamReader(input , "UTF-8")); //$NON-NLS-1$
-	}
-
-	public static BufferedReader getReader(String file) throws UnsupportedEncodingException, FileNotFoundException {
-		return getReader(new File(file), UTF8);
-	}
-
-	public static String getText(File xmlWFile, String string) throws IOException {
-		BufferedReader reader = getReader(xmlWFile);
-		StringBuilder builder = new StringBuilder();
-		try{
-			String line = reader.readLine();
-			while (line != null) {
-				builder.append(line);
-				line = reader.readLine();
-				if (line != null) builder.append("\n");
-			}
-		} finally {
-			reader.close();
-		}
-		return builder.toString();
-	}
-
-	public static PrintWriter getWriter(File file) throws UnsupportedEncodingException, FileNotFoundException {
-		return getWriter(file, UTF8);
-	}
-
-	public static PrintWriter getWriter(File file, String encoding) throws UnsupportedEncodingException, FileNotFoundException {
-		return getWriter(file, encoding, false);
-	}
-	
-	public static PrintWriter getWriter(File file, boolean append) throws UnsupportedEncodingException, FileNotFoundException {
-		return getWriter(file, "UTF-8", append);
-	}
-	
-	public static PrintWriter getWriter(File file, String encoding, boolean append) throws UnsupportedEncodingException, FileNotFoundException {
-		return new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file, append)) , "UTF-8")); //$NON-NLS-1$
-	}
-
-	public static PrintWriter getWriter(String file) throws UnsupportedEncodingException, FileNotFoundException {
-		return getWriter(new File(file), UTF8);
-	}
-
-	public static void write(File file, String str) throws UnsupportedEncodingException, FileNotFoundException {
-		PrintWriter writer = getWriter(file);
-		writer.write(str);
-		writer.close();
-		
-	}
-}
Index: tmp/org.txm.utils/src/org/txm/utils/i18n/Localizer.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/i18n/Localizer.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/i18n/Localizer.java	(revision 296)
@@ -32,7 +32,7 @@
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.UtilsCoreMessages;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -147,7 +147,7 @@
 			return getBundle().getString(key);
 		} catch (MissingResourceException e1) {
 			try {
-				return TXMCoreMessages.Localizer_0 + getDefaultBundle().getString(key);
+				return UtilsCoreMessages.Localizer_0 + getDefaultBundle().getString(key);
 			} catch (MissingResourceException e2) {
 				return key;
 			}
@@ -163,8 +163,8 @@
 		if (bundle == null) {
 			String s = getRessourcePrefix();
 			bundle = loc == null ? ResourceBundle.getBundle(s
-					+ TXMCoreMessages.Localizer_1) : ResourceBundle.getBundle(s
-					+ TXMCoreMessages.Localizer_1, loc);
+					+ UtilsCoreMessages.Localizer_1) : ResourceBundle.getBundle(s
+					+ UtilsCoreMessages.Localizer_1, loc);
 		}
 		return bundle;
 	}
@@ -177,7 +177,7 @@
 	private ResourceBundle getDefaultBundle() {
 		if (default_bundle == null) {
 			String s = getRessourcePrefix();
-			default_bundle = ResourceBundle.getBundle(s + TXMCoreMessages.Localizer_1,
+			default_bundle = ResourceBundle.getBundle(s + UtilsCoreMessages.Localizer_1,
 					new Locale("en", "US")); //$NON-NLS-1$//$NON-NLS-2$ 
 		}
 		return default_bundle;
Index: tmp/org.txm.utils/src/org/txm/utils/ExecTimer.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/ExecTimer.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/ExecTimer.java	(revision 296)
@@ -2,7 +2,7 @@
 
 import java.util.Date;
 
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.UtilsCoreMessages;
 
 public class ExecTimer {
 	static long startTime = 0, endTime = 0;
@@ -20,19 +20,19 @@
 	private static String setMessage(float time) {
 		t = time;
 		if (t < 1000) {
-			message = ""+((int)t)+TXMCoreMessages.ExecTimer_0; //$NON-NLS-1$
+			message = ""+((int)t)+UtilsCoreMessages.ExecTimer_0; //$NON-NLS-1$
 		}
 		else {
 			t = t/1000;
 			if (t < 3) {
 				message = ""+t; //$NON-NLS-1$
-				message = ""+(message.substring(0, 3))+TXMCoreMessages.ExecTimer_1; //$NON-NLS-1$
+				message = ""+(message.substring(0, 3))+UtilsCoreMessages.ExecTimer_1; //$NON-NLS-1$
 			} else if (t < 60) 
-				message = ""+((int)t)+TXMCoreMessages.ExecTimer_1; //$NON-NLS-1$
+				message = ""+((int)t)+UtilsCoreMessages.ExecTimer_1; //$NON-NLS-1$
 			else if (t < 3600) 
-				message = ""+((int)t/60)+TXMCoreMessages.ExecTimer_2+((int)t%60)+TXMCoreMessages.ExecTimer_1; //$NON-NLS-1$
+				message = ""+((int)t/60)+UtilsCoreMessages.ExecTimer_2+((int)t%60)+UtilsCoreMessages.ExecTimer_1; //$NON-NLS-1$
 			else 
-				message = ""+((int)t/3600)+TXMCoreMessages.ExecTimer_3+((int)(t%3600)/60)+TXMCoreMessages.ExecTimer_2+((int)(t%3600)%60)+ TXMCoreMessages.ExecTimer_1; //$NON-NLS-1$
+				message = ""+((int)t/3600)+UtilsCoreMessages.ExecTimer_3+((int)(t%3600)/60)+UtilsCoreMessages.ExecTimer_2+((int)(t%3600)%60)+ UtilsCoreMessages.ExecTimer_1; //$NON-NLS-1$
 		}
 		return message + " ("+(int)time+" ms)"; //$NON-NLS-1$ //$NON-NLS-2$
 	}
Index: tmp/org.txm.utils/src/org/txm/utils/io/FileCopy.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/io/FileCopy.java	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/io/FileCopy.java	(revision 296)
@@ -0,0 +1,206 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2016-11-17 17:01:31 +0100 (Thu, 17 Nov 2016) $
+// $LastChangedRevision: 3341 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.utils.io;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+
+import org.txm.utils.messages.UtilsCoreMessages;
+
+/**
+ * File copy methods
+ */
+public class FileCopy {
+
+	private static final boolean isWindows = System.getProperty("os.name").contains("Windows");
+	
+	/**
+	 * replace the file if it exists
+	 * 
+	 * @param source
+	 * @param dest
+	 * @return
+	 * @throws IOException
+	 */
+	public static boolean copy(File source, File dest) throws IOException {
+		return copy(source, dest, true);
+	}
+	
+	
+	/**
+	 * copy one file with nio package to accelerate the copy 
+	 * 
+	 * !!! on windows : max size = 64mo !!!.
+	 *
+	 * @param source the source
+	 * @param dest the dest
+	 * @return true, if successful
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 */
+	public static boolean copy(File source, File dest, boolean replace) throws IOException {
+		if (dest.exists() && !replace) return true; // don't replace file
+		
+		if (isWindows || source.length() >= Integer.MAX_VALUE) {
+			//System.out.println("COPY BIG FILE");
+			FileInputStream instream = null;
+			BufferedOutputStream outstream = null;
+			try {
+				//Open a stream of bytes to read the file bytes into the program
+				instream = new FileInputStream(source);
+				//A stream of bytes from the program to the destination
+				outstream = new BufferedOutputStream(new FileOutputStream(dest));
+				byte[] buffer = new byte[4096];
+				int bytesRead;
+				//Write the bytes from the inputstream to the outputstream
+				while((bytesRead = instream.read(buffer))!=-1) {
+					outstream.write(buffer, 0, bytesRead);
+				}
+			} catch (Exception e) {org.txm.utils.logger.Log.printStackTrace(e); return false; 
+			} finally {
+				instream.close();
+				outstream.close();
+				instream = null;
+				outstream = null;
+			}
+		} else {
+			//System.out.println("COPY NORMAL FILE");
+			FileChannel in = null, out = null;
+			FileInputStream fis = null;
+			FileOutputStream fos = null;
+			try {
+				fis = new FileInputStream(source);
+				fos = new FileOutputStream(dest);
+				in = fis.getChannel();
+				out = fos.getChannel();
+
+				long size = in.size();
+				MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, size);
+				
+				out.write(buf);
+			} catch(Exception e) {
+				org.txm.utils.logger.Log.printStackTrace(e);
+				
+				if (fis != null) fis.close();
+				if (fos != null) fos.close();
+				if (in != null)	in.close();
+				if (out != null) out.close();
+				
+				return false;
+			} finally {
+				if (fis != null) fis.close();
+				if (fos != null) fos.close();
+				if (in != null)	in.close();
+				if (out != null) out.close();
+			}
+		}
+		return true;
+	}
+
+	/**
+	 * Copy files. Don't erase the destination directory and replace files if they already exists
+	 *
+	 * @param src the src directory
+	 * @param dest the dest directory
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 */
+	public static void copyFiles(File src, File dest) throws IOException {
+
+		// Check to ensure that the source is valid...
+		if (!src.exists()) {
+			throw new IOException(UtilsCoreMessages.FileCopy_0 + src.getAbsolutePath()
+					+ "."); //$NON-NLS-1$ 
+		} else if (!src.canRead()) { // check to ensure we have rights to the
+			// source...
+			throw new IOException(UtilsCoreMessages.FileCopy_2 + src.getAbsolutePath()
+					+ "."); //$NON-NLS-1$ 
+		}
+		
+		// is it a directory ?
+		if (src.isDirectory()) {
+			if (!dest.exists()) { // does the destination already exist?
+				// if not create the file hierarchy
+				if (!dest.mkdirs()) {
+					throw new IOException(UtilsCoreMessages.FileCopy_4
+							+ dest.getAbsolutePath() + "."); //$NON-NLS-1$ 
+				}
+			}
+
+			// get a listing of files...
+			String list[] = src.list();
+			// copy all the files in the list.
+			for (int i = 0; i < list.length; i++) {
+				File dest1 = new File(dest, list[i]);
+				File src1 = new File(src, list[i]);
+				copyFiles(src1, dest1);
+
+			}
+		} else {
+			// This was not a directory, so lets just copy the file
+			copy(src, dest);
+		}
+	}
+
+	public static void main(String[] args) throws IOException {
+//		File test1 = File.createTempFile("source", ".large"); //$NON-NLS-1$ //$NON-NLS-2$
+//		File test2 = File.createTempFile("source", ".verylarge"); //$NON-NLS-1$ //$NON-NLS-2$
+//		
+//		System.out.println("write "+test1); //$NON-NLS-1$
+//		writeBigFile(test1, Integer.MAX_VALUE / 2, 1);
+//		System.out.println("write "+test2); //$NON-NLS-1$
+//		writeBigFile(test2, Integer.MAX_VALUE / 2, 3);
+//		
+//		System.out.println("test1: "+test1+" : "+test1.length()); //$NON-NLS-1$ //$NON-NLS-2$
+//		System.out.println("test2: "+test2+" : "+test2.length()); //$NON-NLS-1$ //$NON-NLS-2$
+//		
+//		File copy1 = File.createTempFile("copy", ".large"); //$NON-NLS-1$ //$NON-NLS-2$
+//		File copy2 = File.createTempFile("copy", ".verylarge"); //$NON-NLS-1$ //$NON-NLS-2$
+//		
+//		System.out.println("Copy1 "+copy1); //$NON-NLS-1$
+//		FileCopy.copy(test1, copy1);
+//		System.out.println("Copy2 "+copy2); //$NON-NLS-1$
+//		FileCopy.copy(test2, copy2);
+//		
+//		System.out.println("copy1: "+copy1+" : "+copy1.length()); //$NON-NLS-1$ //$NON-NLS-2$
+//		System.out.println("copy2: "+copy2+" : "+copy2.length()); //$NON-NLS-1$ //$NON-NLS-2$
+//		
+//		System.out.println("delete 1 "+test1.delete()); //$NON-NLS-1$
+//		System.out.println("delete 2 "+test2.delete()); //$NON-NLS-1$
+//		System.out.println("delete c1 "+copy1.delete()); //$NON-NLS-1$
+//		System.out.println("delete c2 "+copy2.delete()); //$NON-NLS-1$
+		
+		File dir1 = new File("/home/mdecorde/TEMP/copy1");
+		File dir2 = new File("/home/mdecorde/TEMP/copy2");
+		FileCopy.copyFiles(dir1, dir2);
+	}
+}
+

Property changes on: tmp/org.txm.utils/src/org/txm/utils/io/FileCopy.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java	(revision 296)
@@ -0,0 +1,82 @@
+package org.txm.utils.io;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+
+import org.txm.utils.i18n.DetectBOM;
+
+public class IOUtils {
+	public static final String UTF8 = "UTF-8";
+
+	public static BufferedReader getReader(File file) throws UnsupportedEncodingException, FileNotFoundException {
+		return getReader(file, UTF8);
+	}
+
+	public static BufferedReader getReader(File file, String encoding) throws UnsupportedEncodingException, FileNotFoundException {
+		FileInputStream input = new FileInputStream(file);
+		DetectBOM db = new DetectBOM(file);
+		for (int ibom = 0 ; ibom < db.getBOMSize() ; ibom++)
+			try {
+				input.read();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		return new BufferedReader(new InputStreamReader(input , "UTF-8")); //$NON-NLS-1$
+	}
+
+	public static BufferedReader getReader(String file) throws UnsupportedEncodingException, FileNotFoundException {
+		return getReader(new File(file), UTF8);
+	}
+
+	public static String getText(File xmlWFile, String string) throws IOException {
+		BufferedReader reader = getReader(xmlWFile);
+		StringBuilder builder = new StringBuilder();
+		try{
+			String line = reader.readLine();
+			while (line != null) {
+				builder.append(line);
+				line = reader.readLine();
+				if (line != null) builder.append("\n");
+			}
+		} finally {
+			reader.close();
+		}
+		return builder.toString();
+	}
+
+	public static PrintWriter getWriter(File file) throws UnsupportedEncodingException, FileNotFoundException {
+		return getWriter(file, UTF8);
+	}
+
+	public static PrintWriter getWriter(File file, String encoding) throws UnsupportedEncodingException, FileNotFoundException {
+		return getWriter(file, encoding, false);
+	}
+	
+	public static PrintWriter getWriter(File file, boolean append) throws UnsupportedEncodingException, FileNotFoundException {
+		return getWriter(file, "UTF-8", append);
+	}
+	
+	public static PrintWriter getWriter(File file, String encoding, boolean append) throws UnsupportedEncodingException, FileNotFoundException {
+		return new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file, append)) , "UTF-8")); //$NON-NLS-1$
+	}
+
+	public static PrintWriter getWriter(String file) throws UnsupportedEncodingException, FileNotFoundException {
+		return getWriter(new File(file), UTF8);
+	}
+
+	public static void write(File file, String str) throws UnsupportedEncodingException, FileNotFoundException {
+		PrintWriter writer = getWriter(file);
+		writer.write(str);
+		writer.close();
+		
+	}
+}

Property changes on: tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/Pair.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/Pair.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/Pair.java	(revision 296)
@@ -29,7 +29,7 @@
 
 import java.util.HashMap;
 
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.UtilsCoreMessages;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -153,11 +153,11 @@
 		Pair<String, String> p4 = new Pair<String, String>(null, null);
 		System.out.println(p1.equals(new Pair<Integer, Integer>(new Integer(1),
 				new Integer(2)))
-				+ TXMCoreMessages.Pair_0);
-		System.out.println(p4.equals(p2) + TXMCoreMessages.Pair_0);
-		System.out.println(p2.equals(p4) + TXMCoreMessages.Pair_0);
-		System.out.println(p1.equals(p3) + TXMCoreMessages.Pair_1);
-		System.out.println(p4.equals(p4) + TXMCoreMessages.Pair_1);
+				+ UtilsCoreMessages.Pair_0);
+		System.out.println(p4.equals(p2) + UtilsCoreMessages.Pair_0);
+		System.out.println(p2.equals(p4) + UtilsCoreMessages.Pair_0);
+		System.out.println(p1.equals(p3) + UtilsCoreMessages.Pair_1);
+		System.out.println(p4.equals(p4) + UtilsCoreMessages.Pair_1);
 		hashpair.containsKey(p1);
 		hashpair.put(p1,"p1"); //$NON-NLS-1$
 		hashpair.put(p2,"p2"); //$NON-NLS-1$
Index: tmp/org.txm.utils/src/org/txm/utils/Watcher.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/Watcher.java	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/Watcher.java	(revision 296)
@@ -0,0 +1,116 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.utils;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Watcher.
+ *
+ * @author mdecorde
+ * 
+ * Watch for an external tool (such as CWB or R) to be OK and try to restart it
+ */
+public abstract class Watcher implements Runnable{
+
+	/** The process. */
+	boolean process = true;
+	
+	/** The processname. */
+	protected String processname="noname"; //$NON-NLS-1$
+	
+	/** The restartcount. */
+	int restartcount = 0;
+	
+	/** The MAXRESTARTCOUNT. */
+	static int MAXRESTARTCOUNT = 10;
+	
+	/** The DELAY. */
+	static int DELAY = 10000;
+	
+	/** The DEBUG. */
+	static boolean DEBUG = true;
+	
+	
+	/**
+	 * Sets the debug.
+	 *
+	 * @param state the new debug
+	 */
+	public static void setDebug(boolean state)
+	{
+		DEBUG = state;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Runnable#run()
+	 */
+	@Override
+	public void run() {
+		
+		while (process) {
+			try {
+				Thread.sleep(DELAY);
+			} catch (InterruptedException e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+				return;
+			}
+			if (DEBUG) {System.out.println("check "+processname);} //$NON-NLS-1$
+			if (!check())
+			{
+				if (DEBUG){System.out.println("restart "+processname);} //$NON-NLS-1$
+				if (!restart())
+				{
+					System.out.println("Failed to restart : "+processname); //$NON-NLS-1$
+					return;
+				}
+				
+				restartcount++;
+				if (restartcount >= MAXRESTARTCOUNT)
+				{
+					System.out.println(processname+" have been restarted "+MAXRESTARTCOUNT+" times, You should restart TXM."); //$NON-NLS-1$ //$NON-NLS-2$
+					return;
+				}
+			}
+		}
+	}
+	
+	/**
+	 * Check.
+	 *
+	 * @return true, if successful
+	 */
+	abstract protected boolean check();
+	
+	/**
+	 * Restart.
+	 *
+	 * @return true, if successful
+	 */
+	abstract protected boolean restart();
+}

Property changes on: tmp/org.txm.utils/src/org/txm/utils/Watcher.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/logger/MessageBox.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/logger/MessageBox.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/logger/MessageBox.java	(revision 296)
@@ -29,7 +29,7 @@
 
 import java.util.logging.Level;
 
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.UtilsCoreMessages;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -111,7 +111,7 @@
 	 * @param message the message
 	 */
 	public static void severe(String message) {
-		severe(TXMCoreMessages.MessageBox_0, message);
+		severe(UtilsCoreMessages.MessageBox_0, message);
 	}
 
 	/**
@@ -139,7 +139,7 @@
 	 * @param message the message
 	 */
 	public static void warning(String message) {
-		warning(TXMCoreMessages.MessageBox_1, message);
+		warning(UtilsCoreMessages.MessageBox_1, message);
 	}
 
 	/**
@@ -148,7 +148,7 @@
 	 * @param message the message
 	 */
 	public static void info(String message) {
-		info(TXMCoreMessages.MessageBox_2, message);
+		info(UtilsCoreMessages.MessageBox_2, message);
 	}
 
 	/**
Index: tmp/org.txm.utils/src/org/txm/utils/logger/Log.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/logger/Log.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/logger/Log.java	(revision 296)
@@ -38,7 +38,7 @@
 import java.util.logging.Level;
 import java.util.logging.SimpleFormatter;
 
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.UtilsCoreMessages;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -96,7 +96,7 @@
 					String filename = "/tmp/TXM-" + f.format(new Date()) + ".log"; //$NON-NLS-1$ //$NON-NLS-2$
 					
 					fh = new FileHandler(filename, false);
-					System.out.println(TXMCoreMessages.Log_3
+					System.out.println(UtilsCoreMessages.Log_3
 							+ new File(filename).getAbsolutePath());
 					fh.setFormatter(new SimpleFormatter());
 					fh.setEncoding("UTF-8"); //$NON-NLS-1$
@@ -126,7 +126,7 @@
 					fh = new FileHandler(
 									logfiledir.getAbsolutePath()
 											+ "/TXM-" + f.format(new Date()) + ".log", false); //$NON-NLS-1$ //$NON-NLS-2$
-					System.out.println(TXMCoreMessages.Log_5
+					System.out.println(UtilsCoreMessages.Log_5
 							+ logfiledir.getAbsolutePath()
 							+ "TXM-" + f.format(new Date()) + ".log"); //$NON-NLS-2$ //$NON-NLS-1$
 					fh.setFormatter(new SimpleFormatter());
@@ -167,7 +167,7 @@
 						+ t.getLineNumber() + " -> " + e.toString()); //$NON-NLS-1$
 		
 				if ("true".equals(log_stacktrace_boolean)) {
-					message.append(TXMCoreMessages.Log_8);
+					message.append(UtilsCoreMessages.Log_8);
 					for (StackTraceElement se : e.getStackTrace())
 						message.append("\t" + se.getFileName() + "\t" + se.getMethodName() + "\tl." + se.getLineNumber() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 				}
Index: tmp/org.txm.utils/src/org/txm/utils/network/SystemProxyDetector.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/network/SystemProxyDetector.java	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/network/SystemProxyDetector.java	(revision 296)
@@ -0,0 +1,150 @@
+package org.txm.utils.network;
+
+import java.net.InetSocketAddress;
+import java.net.Proxy;
+import java.net.ProxySelector;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import org.eclipse.core.net.proxy.IProxyService;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.util.tracker.ServiceTracker;
+import org.txm.utils.logger.Log;
+
+/**
+ * This class implements various manner to retrieve the system proxy configuration.
+ * It tries to get the configuration from the RCP store and from the Java system properties. 
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class SystemProxyDetector {
+	
+	public String proxy_user = "";
+	public String proxy_password = "";
+	public String proxy_host = "";
+	public int proxy_port = 0;
+
+
+	/**
+	 * Creates a system proxy detector and tries to retrieve the system proxy configuration from  the RCP store and from the Java system properties.
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public SystemProxyDetector() {
+		ServiceTracker proxyTracker = null;
+		try {
+			Bundle c = FrameworkUtil.getBundle(this.getClass());
+			if (c == null) return; // abord;
+			BundleContext bc = c.getBundleContext();
+			if (bc == null) return; // abord;
+			proxyTracker = new ServiceTracker(bc, IProxyService.class.getName(), null);
+			proxyTracker.open();
+
+			IProxyService proxyService = (IProxyService)proxyTracker.getService();
+			if (proxyService.hasSystemProxies()) { // Always response false for Mac OS X, because there is no Eclipse plugin that manages the system proxies
+				try {
+					List<Proxy> proxies = ProxySelector.getDefault().select(new URI("http://textometrie.ens-lyon.fr"));
+					if (proxies != null) {
+						for (Proxy proxy : proxies) {
+							if (proxy.type().equals(Proxy.Type.HTTP)) {
+								InetSocketAddress addr = (InetSocketAddress) proxy.address();
+								if(addr != null) {
+									proxy_host = addr.getHostName();
+									proxy_port = addr.getPort();
+									break; // ok done
+								}
+							}
+						}
+					} 
+				} catch(URISyntaxException e) {
+					Log.printStackTrace(e);
+				}
+			}
+			
+			// last resort to find out proxy configuration
+			if (proxy_host == null || proxy_host.length() == 0) { 
+				proxy_host = System.getProperty("http.proxyHost");
+				String s = System.getProperty("http.proxyPort");
+				if (s != null) proxy_port =  Integer.parseInt(s);
+				proxy_password = System.getProperty("http.proxyPassword");
+				proxy_user = System.getProperty("http.proxyUser");
+			}
+			
+			
+			// Log
+			if(proxy_host != null && !proxy_host.isEmpty())	{
+				Log.info("System proxy network configuration detected.");
+			}
+			
+			// TODO: useless ?
+//			if (proxyTracker == null) {
+//				IProxyData[] data = proxyService.getProxyData();
+//				for (IProxyData d : data) {
+//					proxy_host = d.getHost();
+//					if (IProxyData.HTTP_PROXY_TYPE.equals(d.getType()) && proxy_host != null && proxy_host.length() > 0) {
+//						proxy_port = d.getPort();
+//						proxy_password = d.getPassword();
+//						proxy_user = d.getUserId();
+//						//System.out.println("proxy_server="+proxy_server+" proxy_port="+proxy_port);
+//						
+//						 break; // ok done
+//					} else {
+//						proxy_host = null;
+//					}
+//				}
+//			}
+		} catch (Exception e) {
+			Log.printStackTrace(e);
+		} finally {
+			if (proxyTracker != null) proxyTracker.close();
+		}
+	}
+
+	/**
+	 * Checks if a system proxy has been detected.
+	 * @return
+	 */
+	public boolean isSystemProxyDetected() {
+		return proxy_host != null && !proxy_host.isEmpty();
+	}
+
+
+	/**
+	 * Returns the HTTP system proxy configuration as URL if exists otherwise false.
+	 * @return
+	 */
+	public String getHttpProxyUrl() {
+		
+		String proxyUrl = null;
+		String userData = "";
+		
+		if(this.isSystemProxyDetected())	{
+			proxyUrl = proxy_host + ":" + proxy_port;
+			
+			if (proxy_user != null && !proxy_user.isEmpty()) {
+				userData = proxy_user;
+				proxyUrl = "@" + proxyUrl; //$NON-NLS-1$
+			}
+			if (proxy_password != null && !proxy_password.isEmpty()) {
+				userData += ":" + proxy_password; //$NON-NLS-1$
+			}
+		}
+		else	{
+			Log.warning("HTTP system proxy configuration is not set.");
+		}
+		
+		if(proxyUrl != null)	{
+			proxyUrl = "http://" + userData + proxyUrl; //$NON-NLS-1$
+		}
+		
+		return proxyUrl;
+	}
+
+	public String toString() {
+		return getHttpProxyUrl();
+	}
+}

Property changes on: tmp/org.txm.utils/src/org/txm/utils/network/SystemProxyDetector.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/Sh.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/Sh.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/Sh.java	(revision 296)
@@ -36,8 +36,8 @@
 import java.util.Date;
 import java.util.Locale;
 
-import org.txm.core.messages.TXMCoreMessages;
 import org.txm.utils.logger.Log;
+import org.txm.utils.messages.UtilsCoreMessages;
 
 // TODO: Auto-generated Javadoc
 // Shell
@@ -124,7 +124,7 @@
 			org.txm.utils.logger.Log.printStackTrace(e1);
 		}
 		if (e != 0) {
-			System.err.println(TXMCoreMessages.Sh_4
+			System.err.println(UtilsCoreMessages.Sh_4
 					+ e
 					+ " at " //$NON-NLS-1$
 					+ DateFormat.getDateInstance(DateFormat.FULL, Locale.UK)
@@ -169,7 +169,7 @@
 			org.txm.utils.logger.Log.printStackTrace(e1);
 		}
 		if (e != 0) {
-			Log.info(TXMCoreMessages.Sh_4
+			Log.info(UtilsCoreMessages.Sh_4
 					+ e
 					+ " at " //$NON-NLS-1$
 					+ DateFormat.getDateInstance(DateFormat.FULL, Locale.UK)
Index: tmp/org.txm.utils/src/org/txm/utils/LangDetector.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/LangDetector.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/LangDetector.java	(revision 296)
@@ -9,6 +9,7 @@
 import javax.xml.parsers.ParserConfigurationException;
 
 import org.knallgrau.utils.textcat.TextCategorizer;
+import org.txm.utils.io.IOUtils;
 import org.txm.utils.xml.DomUtils;
 import org.w3c.dom.DOMException;
 import org.xml.sax.SAXException;
Index: tmp/org.txm.utils/src/org/txm/utils/LS.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/LS.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/LS.java	(revision 296)
@@ -2,7 +2,7 @@
 import java.io.File;
 import java.util.ArrayList;
 
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.UtilsCoreMessages;
 
 class LS {
 
@@ -32,7 +32,7 @@
 				}
 			}
 		} else {
-			System.err.println(TXMCoreMessages.LS_0 + dir + TXMCoreMessages.LS_1);
+			System.err.println(UtilsCoreMessages.LS_0 + dir + UtilsCoreMessages.LS_1);
 		}
 		return result;
 	}
Index: tmp/org.txm.utils/src/org/txm/utils/messages/UtilsCoreMessages.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/messages/UtilsCoreMessages.java	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/messages/UtilsCoreMessages.java	(revision 296)
@@ -0,0 +1,47 @@
+package org.txm.utils.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Utils core messages.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class UtilsCoreMessages extends NLS {
+
+	private static final String BUNDLE_NAME = "org.txm.utils.messages.messages"; //$NON-NLS-1$
+	
+	public static String ExecTimer_0;
+	public static String ExecTimer_1;
+	public static String ExecTimer_2;
+	public static String ExecTimer_3;
+	public static String Localizer_0;
+	public static String Localizer_1;
+	public static String FileCopy_0;
+	public static String FileCopy_2;
+	public static String FileCopy_4;
+	public static String LS_0;
+	public static String LS_1;
+	public static String Log_3;
+	public static String Log_5;
+	public static String Log_8;
+	public static String MessageBox_0;
+	public static String MessageBox_1;
+	public static String MessageBox_2;
+	public static String Pair_0;
+	public static String Pair_1;
+	public static String Sh_4;
+
+	
+	
+	
+	static {
+		// initialize resource bundle
+		Utf8NLS.initializeMessages(BUNDLE_NAME, UtilsCoreMessages.class);
+	}
+	
+	
+	
+}

Property changes on: tmp/org.txm.utils/src/org/txm/utils/messages/UtilsCoreMessages.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/messages/messages.properties
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/messages/messages.properties	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/messages/messages.properties	(revision 296)
@@ -0,0 +1,28 @@
+
+ExecTimer_0 = msec
+ExecTimer_1 = sec
+ExecTimer_2 = min and 
+ExecTimer_3 = h, 
+
+FileCopy_0 = ** File copy: failed to find source: 
+FileCopy_2 = ** File copy: access right restriction to source: 
+FileCopy_4 = ** File copy: failed to create directory: 
+
+LS_0 = Error: 
+LS_1 = is not a Directory!
+
+Localizer_0 = [Missing translation] 
+Localizer_1 = messages
+
+Log_3 = Copying logs in 
+Log_5 = Start loging in 
+Log_8 = \nstack:\n
+
+MessageBox_0 = Error
+MessageBox_1 = Warning
+MessageBox_2 = Information
+
+Pair_0 = \ should be false
+Pair_1 = \ should be true
+
+Sh_4 = Process exited abnormally with code 

Property changes on: tmp/org.txm.utils/src/org/txm/utils/messages/messages.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/messages/Utf8NLS.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/messages/Utf8NLS.java	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/messages/Utf8NLS.java	(revision 296)
@@ -0,0 +1,46 @@
+package org.txm.utils.messages;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * Class that manages UTF-8 encoding for .properties messages files.
+ * @author sjacquot
+ *
+ */
+public class Utf8NLS extends NLS {
+
+
+	/**
+	 * Initializes messages using UTF-8 encoding.
+	 * @param baseName
+	 * @param clazz
+	 */
+	public static void initializeMessages(final String baseName, final Class<?> clazz) {
+		// initialize resource bundle
+		NLS.initializeMessages(baseName, clazz);
+
+		// reencode the fields
+		final Field[] fieldArray = clazz.getDeclaredFields();
+		final int len = fieldArray.length;
+		for(int i = 0; i < len; i++) {
+			final Field field = (Field) fieldArray[i];
+			if(field.getType() == java.lang.String.class) {
+				if(!field.isAccessible())
+					field.setAccessible(true);
+				try {
+					final String rawValue = (String) field.get(null);
+					field.set(null, new String(rawValue.getBytes("ISO-8859-1"), "UTF-8"));
+				}
+				catch(Exception e) {
+				//	e.printStackTrace();
+				}
+			}
+		}
+	}
+
+	
+	
+}

Property changes on: tmp/org.txm.utils/src/org/txm/utils/messages/Utf8NLS.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/messages/messages_ru.properties
===================================================================

Property changes on: tmp/org.txm.utils/src/org/txm/utils/messages/messages_ru.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/messages/messages_fr.properties	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/messages/messages_fr.properties	(revision 296)
@@ -0,0 +1,28 @@
+﻿
+ExecTimer_0 = \ msec
+ExecTimer_1 = \ sec
+ExecTimer_2 = \ min et 
+ExecTimer_3 = h, 
+
+FileCopy_0 = ** Copie de fichiers : échec d'accès à la source : 
+FileCopy_2 = ** Copie de fichiers : droits d'accès insuffisants à la source : 
+FileCopy_4 = ** Copie de fichiers : échec de création du dossier : 
+
+LS_0 = Erreur : 
+LS_1 = \ n'est pas un dossier
+
+Localizer_0 = [Traduction manquante] 
+Localizer_1 = messages
+
+Log_3 = Copie des messages dans 
+Log_5 = Ecriture des messages dans
+Log_8 = \nstack:\n
+
+MessageBox_0 = Erreur
+MessageBox_1 = Attention
+MessageBox_2 = Information
+
+Pair_0 = \ devrait valoir faux
+Pair_1 = \ devrait valoir vrai
+
+Sh_4 = Le processus a terminé avec le code d'erreur : 

Property changes on: tmp/org.txm.utils/src/org/txm/utils/messages/messages_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.utils/src/org/txm/utils/Activator.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/Activator.java	(revision 295)
+++ tmp/org.txm.utils/src/org/txm/utils/Activator.java	(revision 296)
@@ -1,12 +1,12 @@
 package org.txm.utils;
 
-import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.core.runtime.Plugin;
 import org.osgi.framework.BundleContext;
 
 /**
  * The activator class controls the plug-in life cycle
  */
-public class Activator extends AbstractUIPlugin {
+public class Activator extends Plugin {
 
 	// The plug-in ID
 	public static final String PLUGIN_ID = "org.txm.utils"; //$NON-NLS-1$
