Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/SECompatLibraryTest.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/SECompatLibraryTest.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/SECompatLibraryTest.java	(revision 38333)
@@ -0,0 +1,53 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ * 
+ * This program 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.
+ * 
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ */
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 {DiSiD Technologies}  {{Task}}
+ */
+package org.gvsig.compat.se;
+
+import junit.framework.TestCase;
+
+import org.gvsig.compat.CompatLocator;
+import org.gvsig.compat.se.lang.StandardStringUtils;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+/**
+ * Unit tests for the {@link SECompatLibrary} class.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public class SECompatLibraryTest extends TestCase {
+
+    /**
+     * Test method for {@link org.gvsig.compat.se.SECompatLibrary#initialize()}.
+     */
+    public void testInitialize() {
+        new DefaultLibrariesInitializer().fullInitialize();
+
+        // Check if the correct implementation is returned
+        assertEquals(StandardStringUtils.class, CompatLocator.getStringUtils()
+                .getClass());
+    }
+
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/lang/SEMathUtilsTest.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/lang/SEMathUtilsTest.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/lang/SEMathUtilsTest.java	(revision 38333)
@@ -0,0 +1,38 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program 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.
+* 
+* This program 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 this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 PRODEVELOP S.L. Main Development
+ */
+package org.gvsig.compat.se.lang;
+
+import org.gvsig.compat.lang.MathUtils;
+import org.gvsig.compat.lang.MathUtilsTestParent;
+
+public class SEMathUtilsTest extends MathUtilsTestParent{
+
+	protected MathUtils createUtils() {
+		return new SEMathUtils();
+	}
+
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/lang/StandardStringUtilsTest.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/lang/StandardStringUtilsTest.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/se/lang/StandardStringUtilsTest.java	(revision 38333)
@@ -0,0 +1,44 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ * 
+ * This program 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.
+ * 
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ */
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 {{Company}}   {{Task}}
+ */
+package org.gvsig.compat.se.lang;
+
+import org.gvsig.compat.lang.StringUtils;
+import org.gvsig.compat.lang.StringUtilsTestParent;
+
+/**
+ * Unit tests for the {@link org.gvsig.compat.se.lang.StandardStringUtils}
+ * class.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public class StandardStringUtilsTest extends StringUtilsTestParent {
+
+    protected StringUtils createUtils() {
+        return new StandardStringUtils();
+    }
+
+}
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/CompatLibraryTest.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/CompatLibraryTest.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/CompatLibraryTest.java	(revision 38333)
@@ -0,0 +1,61 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ * 
+ * This program 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.
+ * 
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ */
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 {DiSiD Technologies}  {{Task}}
+ */
+package org.gvsig.compat;
+
+import junit.framework.TestCase;
+
+import org.gvsig.tools.library.Library;
+
+/**
+ * Unit tests for the {@link CompatLibrary} class.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public class CompatLibraryTest extends TestCase {
+
+    /**
+     * Test method for {@link org.gvsig.compat.se.SECompatLibrary#initialize()}.
+     */
+    public void testInitialize() {
+        Library api = new CompatLibrary();
+
+        // 1: Initialize the Library
+        api.initialize();
+
+        // 2: postInitialize them
+        // as we don't initialize an implementation library,
+        // the postInitialization must throw an Exception
+        try {
+            api.postInitialize();
+            fail("Library postInitialization is not checking "
+                    + "for implementation availability");
+        } catch (Exception ex) {
+            // Good
+        }
+    }
+
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/lang/MathUtilsTestParent.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/lang/MathUtilsTestParent.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/lang/MathUtilsTestParent.java	(revision 38333)
@@ -0,0 +1,61 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program 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.
+* 
+* This program 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 this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 PRODEVELOP S.L. Main Development
+ */
+package org.gvsig.compat.lang;
+
+import junit.framework.TestCase;
+
+/**
+ * Parent class for Unit tests for {@link org.gvsig.compat.lang.MathUtils}
+ * implementations.
+ * 
+ * @author <a href="mailto:jcarrasco@prodevelop.es">Javier Carrasco</a>
+ */
+public abstract class MathUtilsTestParent extends TestCase{
+	
+	private MathUtils utils;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        utils = createUtils();
+    }
+
+    /**
+     * Return a new instance of an implementation of the MathUtils interface.
+     * 
+     * @return a new MathUtils instance
+     */
+    protected abstract MathUtils createUtils();
+    
+    /**
+     * Test method for
+     * {@link org.gvsig.compat.se.lang.MathUtils#log10(double)}
+     * .
+     */
+    public void testLog10() {
+    	assertEquals(utils.log10(1000),3.0,0.00000000001);
+    }
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/lang/StringUtilsTestParent.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/lang/StringUtilsTestParent.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src-test/org/gvsig/compat/lang/StringUtilsTestParent.java	(revision 38333)
@@ -0,0 +1,132 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ * 
+ * This program 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.
+ * 
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ */
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 {{Company}}   {{Task}}
+ */
+package org.gvsig.compat.lang;
+
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+/**
+ * Parent class for Unit tests for {@link org.gvsig.compat.lang.StringUtils}
+ * implementations.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public abstract class StringUtilsTestParent extends TestCase {
+
+	private StringUtils utils;
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		utils = createUtils();
+	}
+
+	/**
+	 * Return a new instance of an implementation of the StringUtils interface.
+	 * 
+	 * @return a new StringUtils instance
+	 */
+	protected abstract StringUtils createUtils();
+
+	/**
+	 * Test method for
+	 * {@link org.gvsig.compat.se.lang.StandardStringUtils#split(java.lang.String, java.lang.String)}
+	 * .
+	 */
+	public void testSplitString() {
+		// Check the result is the same as the returned with the String.split
+		// method.
+		List list1;
+		List list2;
+
+		String testString = "En un lugar de la Mancha";
+		String regex = " ";
+
+		list1 = Arrays.asList(new String[] { "En", "un", "lugar", "de", "la",
+				"Mancha" });
+
+		list2 = Arrays.asList(utils.split(testString, regex));
+
+		assertEquals(list1, list2);
+
+		list1 = Arrays.asList(new String[] { "En", "un lugar de la Mancha" });
+
+		list2 = Arrays.asList(utils.split(testString, regex, 2));
+
+		assertEquals(list1, list2);
+	}
+
+	/**
+	 * Test method for
+	 * {@link org.gvsig.compat.se.lang.StandardStringUtils#replaceAll(java.lang.String, java.lang.String, java.lang.String)}
+	 * .
+	 */
+	public void testReplaceAll() {
+		// Check the result is the same as the returned with the
+		// String.replaceAll method.
+		String testString = "En un lugar de la Mancha";
+		String regex = " ";
+		String replacement = "_";
+
+		assertEquals("En_un_lugar_de_la_Mancha",
+				utils.replaceAll(testString, regex, replacement));
+
+		// Check replaceFirst
+		assertEquals("En_un lugar de la Mancha",
+				utils.replaceFirst(testString, regex, replacement));
+	}
+
+	/**
+	 * Test method for
+	 * {@link org.gvsig.compat.se.lang.StandardStringUtils#compare(String, String, boolean)}
+	 * .
+	 */
+	public void testCompare() {
+		String avion = "Avi�n";
+		String avionaccent = "Avion";
+		String barco = "Barco";
+
+		// Same value
+		assertEquals(avion + " is not equal to " + avion, 0,
+				utils.compare(avion, avion, false));
+		assertEquals(avion + " is not equal to " + avion, 0,
+				utils.compare(avion, avion, true));
+
+		// Non localized comparison
+		assertTrue(utils.compare(avion, barco, false) < 0);
+		assertTrue(utils.compare(avion, avionaccent, false) > 0);
+		assertTrue(utils.compare(barco, avion, false) > 0);
+		assertTrue(utils.compare(avionaccent, avion, false) < 0);
+
+		// Localized comparison, so accents must not be taken into account
+		assertTrue(utils.compare(avion, barco, true) < 0);
+		assertEquals(0, utils.compare(avion, avionaccent, true));
+		assertTrue(utils.compare(barco, avion, true) > 0);
+		assertEquals(0, utils.compare(avionaccent, avion, true));
+	}
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources-test/log4j.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources-test/log4j.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources-test/log4j.xml	(revision 38333)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.compat">
+		<priority value="DEBUG" /> 
+	</category>
+
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/CompatLibrary.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/CompatLibrary.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/CompatLibrary.java	(revision 38333)
@@ -0,0 +1,86 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ * 
+ * This program 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.
+ * 
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ */
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 DiSiD Technologies   Create initial base implementation
+ */
+package org.gvsig.compat;
+
+import org.gvsig.compat.lang.GraphicsUtils;
+import org.gvsig.compat.lang.MathUtils;
+import org.gvsig.compat.lang.StringUtils;
+import org.gvsig.compat.net.Downloader;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+
+/**
+ * Initialization of the libCompat library.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public class CompatLibrary extends AbstractLibrary {
+
+    public void doRegistration() {
+        registerAsAPI(CompatLibrary.class);
+    }
+
+	protected void doInitialize() throws LibraryException {
+		// Nothing to do
+	}
+
+	protected void doPostInitialize() throws LibraryException {
+		// Validate there is any implementation registered.
+		StringUtils stringUtils = CompatLocator.getStringUtils();
+		
+		if (stringUtils == null) {
+			throw new ReferenceNotRegisteredException(
+					CompatLocator.STRINGUTILS_NAME, CompatLocator.getInstance());
+		}
+		
+		// Validate there is any implementation registered.
+		MathUtils mathUtils = CompatLocator.getMathUtils();
+		
+		if (mathUtils == null) {
+			throw new ReferenceNotRegisteredException(
+					CompatLocator.MATHUTILS_NAME, CompatLocator.getInstance());
+		}
+		
+		// Validate there is any implementation registered.
+		GraphicsUtils gUtils = CompatLocator.getGraphicsUtils();
+		
+		if (gUtils == null) {
+			throw new ReferenceNotRegisteredException(
+					CompatLocator.GRAPHICSUTILS_NAME, CompatLocator.getInstance());
+		}
+		
+		  // Validate there is any implementation registered for the Downloader.
+        Downloader downloader = CompatLocator.getDownloader();
+        
+        if (downloader == null) {
+            throw new ReferenceNotRegisteredException(
+                    CompatLocator.DOWNLOADER_NAME, CompatLocator.getInstance());
+        }
+	}
+
+}
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/print/PrintAttributes.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/print/PrintAttributes.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/print/PrintAttributes.java	(revision 38333)
@@ -0,0 +1,37 @@
+package org.gvsig.compat.print;
+
+/**
+ * Multi-platform interface to store print attributes.
+ * Currently ionly supports the printing quality attribute
+ * 
+ * @author Juan Lucas Dominguez Rubio jldominguez at prodevelop.es
+ *
+ */
+public interface PrintAttributes {
+	
+	/**
+	 * Constant to indicate a poor printing quality (useful for drafts, etc) 
+	 */
+	public static final int PRINT_QUALITY_DRAFT = 0;
+	/**
+	 * Constant to indicate a normal printing quality 
+	 */
+	public static final int PRINT_QUALITY_NORMAL = 1;
+	/**
+	 * Constant to indicate a high printing quality 
+	 */
+	public static final int PRINT_QUALITY_HIGH = 2;
+	
+	/**
+	 * Gets the print quality value for this object.
+	 * @return the print quality value for this object.
+	 */
+	public int getPrintQuality();
+	
+	/**
+	 * Sets the print quality value for this object.
+	 * @param pq the new value for the print quality value
+	 */
+	public void setPrintQuality(int pq);
+
+}

Property changes on: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/print/PrintAttributes.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Id URL
Added: svn:eol-style
   + native

Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/StringUtils.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/StringUtils.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/StringUtils.java	(revision 38333)
@@ -0,0 +1,81 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program 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.
+* 
+* This program 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 this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 DiSiD Technologies   Extract interface for the StringUtils utility
+ */
+package org.gvsig.compat.lang;
+
+/**
+ * String Utilities used for Java SE-ME compatibility.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public interface StringUtils {
+    
+    /**
+     * Compatible implementation of the String.split(regexp) method.
+     * @see String#split(String)
+     */
+    String[] split(String input, String regex);
+    
+    /**
+     * Compatible implementation of the String.split(regexp, limit) method.
+     * @see String#split(String, int)
+     */
+    String[] split(String input, String regex, int limit);
+    
+    /**
+     * Compatible implementation of the String.replaceAll(regexp, replacement)
+     * method.
+     * 
+     * @see String#replaceAll(String, String)
+     */
+    String replaceAll(String input, String regex,
+            String replacement);
+    
+    /**
+     * Compatible implementation of the String.replaceFirst(regexp, replacement)
+     * method.
+     * 
+     * @see String#replaceFirst(String, String)
+     */
+    String replaceFirst(String input, String regex,
+            String replacement);
+
+	/**
+	 * Compares two Strings, maybe taking into account the current locale.
+	 * 
+	 * @param source
+	 *            the source text
+	 * @param target
+	 *            the target text to compare to
+	 * @param localized
+	 *            if the comparison must be made with the current locale (ex: if
+	 *            making a difference between accented characters or not).
+	 * @return Returns an integer value. Value is less than zero if source is
+	 *         less than target, value is zero if source and target are equal,
+	 *         value is greater than zero if source is greater than target.
+	 */
+	int compare(String source, String target, boolean localized);
+}
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/MathUtils.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/MathUtils.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/MathUtils.java	(revision 38333)
@@ -0,0 +1,40 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program 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.
+* 
+* This program 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 this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 PRODEVELOP S.L. Main Development
+ */
+package org.gvsig.compat.lang;
+
+/**
+ * Math Utilities used for Java SE-ME compatibility.
+ * 
+ * @author <a href="mailto:jcarrasco@prodevelop.es">Javier Carrasco</a>
+ */
+public interface MathUtils {
+	/**
+     * Compatible implementation of the Math.log10(double) method.
+     * @see Math#log10(double)
+     */
+    double log10(double value);
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/GraphicsUtils.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/GraphicsUtils.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/GraphicsUtils.java	(revision 38333)
@@ -0,0 +1,83 @@
+package org.gvsig.compat.lang;
+
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+
+import org.gvsig.compat.print.PrintAttributes;
+
+/**
+ * Multi-platform graphic utils interface.
+ * This allows platforms with poor java.awt.Graphics2D implementations to
+ * share most of the application source code.
+ *   
+ * @author Juan Lucas Dominguez Rubio jldominguez at prodevelop.es
+ *
+ */
+public interface GraphicsUtils {
+	
+	/**
+	 * Create a buffered Image of the given size and type.
+	 * In this context, buffered image means editable image (admits setRGB etc)
+	 *  
+	 * @param w width in pixels of the requested image
+	 * @param h height in pixels of the requested image
+	 * @param type image type (refers to bands, etc. see {@link Image}
+	 * @return a buffered (editable) image of the desired size and type
+	 */
+	public BufferedImage createBufferedImage(int w, int h, int type);
+	
+	/**
+	 * Produces a copy of a buffered image with the same graphic content (pixel color)
+	 * @param img image to be copied
+	 * @return new instance of a BufferedImage (editable) with same size, type and graphic content.
+	 */
+	public BufferedImage copyBufferedImage(BufferedImage img);
+	
+	/**
+	 * Returns an istance of Font which is the same as the one provided except for the size.
+	 * 
+	 * @param srcfont provided font to be used as model
+	 * @param newheight height in pixels of the new fonr 
+	 * @return the new font, same properties as the provided font, but different size
+	 */
+	public Font deriveFont(Font srcfont, float newheight);
+	
+	/**
+	 * Returns device screen DPI (dots per inch)
+	 * 
+	 * @return number of pixels per inch in the current screen
+	 */
+	public int getScreenDPI();
+
+	/**
+	 * Adds a translation operation to the Graphics2D object's transformation matrix.
+	 *   
+	 * @param g Object whose transformation matrix has to be modified
+	 * @param x horizontal offset of the translation 
+	 * @param y vertical offset of the translation
+	 */
+	public void translate(Graphics2D g, double x, double y);
+	
+	/**
+	 * Creates an object that implements the PrintAttributes interface with default/trivial values.
+	 * 
+	 * @return an object that implements the PrintAttributes interface with default/trivial values.
+	 */
+	public PrintAttributes createPrintAttributes();
+	
+	/**
+	 * Sets the rendering hints to the Graphics2D object in a way that is suitable for drawing.
+	 *  
+	 * @param g the Graphics2D object whose rendering hints have to be set for drawing
+	 */
+	public void setRenderingHintsForDrawing(Graphics2D g);
+	
+	/**
+	 * Sets the rendering hints to the Graphics2D object in a way that is suitable for printing.
+	 *  
+	 * @param g the Graphics2D object whose rendering hints have to be set for printing
+	 */
+	public void setRenderingHintsForPrinting(Graphics2D g);
+}

Property changes on: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/lang/GraphicsUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Id URL
Added: svn:eol-style
   + native

Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/net/Downloader.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/net/Downloader.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/net/Downloader.java	(revision 38333)
@@ -0,0 +1,81 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.compat.net;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.URL;
+import java.net.UnknownHostException;
+
+
+
+/**
+ * @author gvSIG Team
+ * @version $Id$
+ *
+ */
+public interface Downloader {
+    /**
+     * Downloads an URL into a temporary file that is removed the next time the
+     * tempFileManager class is called, which means the next time gvSIG is launched.
+     *
+     * @param url
+     * @param name
+     * @return
+     * @throws IOException
+     * @throws ServerErrorResponseException
+     * @throws ConnectException
+     * @throws UnknownHostException
+     */
+    public File downloadFile(URL url, String name, ICancellable cancel) throws IOException,ConnectException, UnknownHostException;
+    
+
+    /**
+     * Downloads a URL using the HTTP Post protocol
+     * @param url
+     * The server URL
+     * @param data
+     * The data to send in the request
+     * @param name
+     * A common name for all the retrieved files
+     * @param cancel
+     * Used to cancel the downloads
+     * @return
+     * The retrieved file
+     * @throws IOException
+     * @throws ConnectException
+     * @throws UnknownHostException
+     */
+    public File downloadFile(URL url, String data, String name, ICancellable cancel) throws IOException,ConnectException, UnknownHostException;
+ 
+    public void removeURL(URL url);
+    
+    public void removeURL(Object url);
+    
+    /**
+     * Cleans every temporal file previously downloaded.
+     */
+    public void cleanUpTempFiles();
+       
+
+}

Property changes on: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/net/Downloader.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/net/ICancellable.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/net/ICancellable.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/net/ICancellable.java	(revision 38333)
@@ -0,0 +1,73 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+/* CVS MESSAGES:
+ *
+ * $Id: ICancellable.java 29658 2009-06-29 17:10:19Z jpiera $
+ * $Log$
+ * Revision 1.1  2006-05-24 16:37:34  jaume
+ * *** empty log message ***
+ *
+ *
+ */
+package org.gvsig.compat.net;
+
+/**
+ * <p>When a task is accessing to remote data, takes an indeterminate time, and occasionally gets locked. That's
+ * the reason a task should support to be cancelable.</p>
+ * <p><code>ICancellable</code> interface is designed for getting information about the cancellation of a
+ * task of downloading remote information.</p>
+ */
+public interface ICancellable {
+	/**
+	 * <p>Returns <code>true</code> if a download or a group of downloads tasks has been canceled.</p>
+	 * 
+	 * @return <code>true</code> if a download or a group of downloads tasks has been canceled, otherwise <code>false</code>
+	 */
+	public boolean isCanceled();
+	
+	/**
+	 * <p>Used to cancel only a group of downloads tasks with the same identifier.</p>
+	 * 
+	 * @return the identifier
+	 */
+	public Object getID();
+}

Property changes on: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/net/ICancellable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/CompatLocator.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/CompatLocator.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/CompatLocator.java	(revision 38333)
@@ -0,0 +1,191 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program 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.
+* 
+* This program 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 this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 DiSiD Technologies   Create initial base implementation
+ */
+package org.gvsig.compat;
+
+import org.gvsig.compat.lang.GraphicsUtils;
+import org.gvsig.compat.lang.MathUtils;
+import org.gvsig.compat.lang.StringUtils;
+import org.gvsig.compat.net.Downloader;
+import org.gvsig.tools.locator.BaseLocator;
+import org.gvsig.tools.locator.Locator;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * Locator for the libCompat Library. Returns references to the library's main
+ * utilities.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public class CompatLocator extends BaseLocator {
+    
+    /**
+     * The name of the StringUtils reference.
+     */
+    public static final String STRINGUTILS_NAME = "StringUtils";
+    
+    /**
+     * The name of the MathUtils reference.
+     */
+    public static final String MATHUTILS_NAME = "MathUtils";
+    public static final String GRAPHICSUTILS_NAME = "GraphicsUtils";
+
+    /**
+     * The description of the StringUtils reference.
+     */
+    private static final String STRINGUTILS_DESCRIPTION = "Compatible implementation for String Utilities";
+    
+    /**
+     * The description of the MathUtils reference.
+     */
+    private static final String MATHUTILS_DESCRIPTION = "Compatible implementation for Math Utilities";
+    private static final String GRAPHICSUTILS_DESCRIPTION = "Compatible implementation for Graphics Utilities";
+    
+    /**
+     * The name and the description for the {@link Downloader} reference.
+     */
+    public static final String DOWNLOADER_NAME = "Downloader";
+    public static final String DOWNLOADER_DESCRIPTION = "Downloader descripction";
+
+    /**
+     * Unique instance.
+     */
+    private static final CompatLocator instance = new CompatLocator();
+
+    /**
+     * Return the singleton instance.
+     * 
+     * @return the singleton instance
+     */
+    public static CompatLocator getInstance() {
+        return instance;
+    }
+
+    /**
+     * Return a reference to StringUtils.
+     * 
+     * @return a reference to StringUtils
+     * @throws LocatorException
+     *             if there is no access to the class or the class cannot be
+     *             instantiated
+     * @see Locator#get(String)
+     */
+    public static StringUtils getStringUtils() throws LocatorException {
+        return (StringUtils) getInstance().get(STRINGUTILS_NAME);
+    }
+
+    /**
+     * Return a reference to MathUtils.
+     * 
+     * @return a reference to MathUtils
+     * @throws LocatorException
+     *             if there is no access to the class or the class cannot be
+     *             instantiated
+     * @see Locator#get(String)
+     */
+    public static MathUtils getMathUtils() throws LocatorException {
+        return (MathUtils) getInstance().get(MATHUTILS_NAME);
+    }
+
+    
+    /**
+     * Registers the Class implementing the MathUtils interface.
+     * 
+     * @param clazz
+     *            implementing the MathUtils interface
+     */
+    public static void registerMathUtils(Class clazz) {
+        getInstance()
+                .register(MATHUTILS_NAME, MATHUTILS_DESCRIPTION, clazz);
+    }
+    
+    /**
+     * Registers the Class implementing the StringUtils interface.
+     * 
+     * @param clazz
+     *            implementing the StringUtils interface
+     */
+    public static void registerStringUtils(Class clazz) {
+        getInstance()
+                .register(STRINGUTILS_NAME, STRINGUTILS_DESCRIPTION, clazz);
+    }
+    
+    // ============================================================
+    // ============================================================
+    // ============================================================
+    
+    /**
+     * Return a reference to GraphicsUtils.
+     * 
+     * @return a reference to GraphicsUtils
+     * @throws LocatorException
+     *             if there is no access to the class or the class cannot be
+     *             instantiated
+     * @see Locator#get(String)
+     */
+    public static GraphicsUtils getGraphicsUtils() throws LocatorException {
+        return (GraphicsUtils) getInstance().get(GRAPHICSUTILS_NAME);
+    }
+
+    
+    /**
+     * Registers the Class implementing the GraphicsUtils interface.
+     * 
+     * @param clazz
+     *            implementing the GraphicsUtils interface
+     */
+    public static void registerGraphicsUtils(Class clazz) {
+        getInstance()
+                .register(GRAPHICSUTILS_NAME, GRAPHICSUTILS_DESCRIPTION, clazz);
+    }
+    
+    /**
+     * Return a reference to GraphicsUtils.
+     * 
+     * @return a reference to GraphicsUtils
+     * @throws LocatorException
+     *             if there is no access to the class or the class cannot be
+     *             instantiated
+     * @see Locator#get(String)
+     */
+    public static Downloader getDownloader() throws LocatorException {
+        return (Downloader) getInstance().get(DOWNLOADER_NAME);
+    }
+
+    
+    /**
+     * Registers the Class implementing the GraphicsUtils interface.
+     * 
+     * @param clazz
+     *            implementing the GraphicsUtils interface
+     */
+    public static void registerDownloader(Class clazz) {
+        getInstance()
+                .register(DOWNLOADER_NAME, DOWNLOADER_DESCRIPTION, clazz);
+    }
+    
+    
+}
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/print/SePrintAttributes.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/print/SePrintAttributes.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/print/SePrintAttributes.java	(revision 38333)
@@ -0,0 +1,26 @@
+package org.gvsig.compat.se.print;
+
+import org.gvsig.compat.print.PrintAttributes;
+
+/**
+ * JSE (Desktop Java) implementation of {@link PrintAttributes}
+ * 
+ * @author Juan Lucas Dominguez Rubio jldominguez at prodevelop.es
+ * 
+ * @see PrintAttributes
+ *
+ */
+public class SePrintAttributes implements PrintAttributes{
+
+	int pq = 0;
+	
+	public int getPrintQuality() {
+		return pq;
+	}
+
+	public void setPrintQuality(int pq) {
+		this.pq=pq;
+		
+	}
+
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/SECompatLibrary.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/SECompatLibrary.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/SECompatLibrary.java	(revision 38333)
@@ -0,0 +1,59 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program 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.
+* 
+* This program 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 this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 DiSiD Technologies   Create initial base implementation
+ */
+package org.gvsig.compat.se;
+
+import org.gvsig.compat.CompatLibrary;
+import org.gvsig.compat.CompatLocator;
+import org.gvsig.compat.se.lang.SEGraphUtils;
+import org.gvsig.compat.se.lang.SEMathUtils;
+import org.gvsig.compat.se.lang.StandardStringUtils;
+import org.gvsig.compat.se.net.SEDownloader;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Initialization of the libCompat library, Java Standard Edition
+ * implementation.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public class SECompatLibrary extends AbstractLibrary {
+	
+    public void doRegistration() {
+        registerAsImplementationOf(CompatLibrary.class);
+    }
+
+	protected void doInitialize() throws LibraryException {
+		CompatLocator.registerStringUtils(StandardStringUtils.class);
+		CompatLocator.registerMathUtils(SEMathUtils.class);
+		CompatLocator.registerGraphicsUtils(SEGraphUtils.class);
+		CompatLocator.registerDownloader(SEDownloader.class);
+	}
+
+	protected void doPostInitialize() throws LibraryException {
+	}
+}
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/StandardStringUtils.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/StandardStringUtils.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/StandardStringUtils.java	(revision 38333)
@@ -0,0 +1,66 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ * 
+ * This program 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.
+ * 
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ */
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 DiSiD Technologies   Create initial implementation of StringUtils for Java SE.
+ */
+package org.gvsig.compat.se.lang;
+
+import java.text.Collator;
+
+import org.gvsig.compat.lang.StringUtils;
+
+/**
+ * String utilities implementation for Java Standard Edition.
+ * 
+ * @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
+ */
+public class StandardStringUtils implements StringUtils {
+
+	public String[] split(String input, String regex) {
+		return input == null ? null : input.split(regex);
+	}
+
+	public String[] split(String input, String regex, int limit) {
+		return input == null ? null : input.split(regex, limit);
+	}
+
+	public String replaceAll(String input, String regex, String replacement) {
+		return input == null ? null : input.replaceAll(regex, replacement);
+	}
+
+	public String replaceFirst(String input, String regex, String replacement) {
+		return input == null ? null : input.replaceFirst(regex, replacement);
+	}
+
+	public int compare(String source, String target, boolean localized) {
+		if (localized) {
+			Collator collator = Collator.getInstance();
+			collator.setStrength(Collator.PRIMARY);
+			return collator.compare(source, target);
+		} else {
+			return source.compareTo(target);
+		}
+	}
+
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/SEGraphUtils.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/SEGraphUtils.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/SEGraphUtils.java	(revision 38333)
@@ -0,0 +1,90 @@
+package org.gvsig.compat.se.lang;
+
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Toolkit;
+import java.awt.image.BufferedImage;
+import java.awt.image.WritableRaster;
+import java.util.prefs.Preferences;
+
+import org.gvsig.compat.lang.GraphicsUtils;
+import org.gvsig.compat.print.PrintAttributes;
+import org.gvsig.compat.se.print.SePrintAttributes;
+
+/**
+ * JSE (Desktop Java) implementation of {@link GraphicsUtils}
+ * 
+ * @author Juan Lucas Dominguez Rubio jldominguez at prodevelop.es
+ * 
+ * @see GraphicsUtils
+ *
+ */
+public class SEGraphUtils implements GraphicsUtils{
+
+	public BufferedImage copyBufferedImage(BufferedImage img) {
+		
+		BufferedImage image = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());
+		WritableRaster w = image.getRaster();
+		img.copyData(w);
+		return image;
+	}
+
+	public BufferedImage createBufferedImage(int w, int h, int type) {
+		BufferedImage res = new BufferedImage(
+				w,
+				h,
+				type);
+		return res;
+	}
+
+	public PrintAttributes createPrintAttributes() {
+		return new SePrintAttributes();
+	}
+
+	public Font deriveFont(Font srcfont, float newheight) {
+		return srcfont.deriveFont(newheight);
+	}
+
+	/**
+	 * Tries to use DPI value from gvSIG preferences. If this does not exist, gets
+	 * value from Java Toolkit. 
+	 */
+	public int getScreenDPI() {
+		
+		Preferences prefsResolution = Preferences.userRoot().node("gvsig.configuration.screen");
+		Toolkit kit = Toolkit.getDefaultToolkit();
+		int dpi = prefsResolution.getInt("dpi", kit.getScreenResolution());
+		return dpi;
+	}
+
+	public void translate(Graphics2D g, double x, double y) {
+		g.translate(x, y);
+		
+	}
+
+	public void setRenderingHintsForDrawing(Graphics2D g) {
+		
+		RenderingHints renderHints = new RenderingHints(
+				RenderingHints.KEY_ANTIALIASING,
+				RenderingHints.VALUE_ANTIALIAS_ON);
+		renderHints.put(RenderingHints.KEY_RENDERING,
+				RenderingHints.VALUE_RENDER_QUALITY);
+		renderHints.put(RenderingHints.KEY_TEXT_ANTIALIASING,
+				RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+		g.setRenderingHints(renderHints);
+		
+	}
+
+	public void setRenderingHintsForPrinting(Graphics2D g) {
+		
+		RenderingHints renderHints = new RenderingHints(
+				RenderingHints.KEY_ANTIALIASING,
+				RenderingHints.VALUE_ANTIALIAS_ON);
+		renderHints.put(RenderingHints.KEY_RENDERING,
+				RenderingHints.VALUE_RENDER_QUALITY);
+		g.setRenderingHints(renderHints);
+		
+	}
+
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/SEMathUtils.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/SEMathUtils.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/lang/SEMathUtils.java	(revision 38333)
@@ -0,0 +1,45 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program 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.
+* 
+* This program 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 this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+
+/*
+ * AUTHORS (In addition to CIT):
+ * 2008 PRODEVELOP S.L. Main Development
+ */
+package org.gvsig.compat.se.lang;
+
+import org.gvsig.compat.lang.MathUtils;
+
+/**
+ * JSE (Desktop Java) implementation of {@link MathUtils}
+ * 
+ * @author Juan Lucas Dominguez Rubio jldominguez at prodevelop.es
+ * 
+ * @see MathUtils
+ *
+ */
+public class SEMathUtils implements MathUtils{
+
+	public double log10(double value) {
+		return Math.log10(value);
+	}
+
+}
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/net/SEDownloader.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/net/SEDownloader.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/net/SEDownloader.java	(revision 38333)
@@ -0,0 +1,592 @@
+package org.gvsig.compat.se.net;
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ *
+ * For more information, contact:
+ *
+ *  Generalitat Valenciana
+ *   Conselleria d'Infraestructures i Transport
+ *   Av. Blasco Ib��ez, 50
+ *   46010 VALENCIA
+ *   SPAIN
+ *
+ *      +34 963862235
+ *   gvsig@gva.es
+ *      www.gvsig.gva.es
+ *
+ *    or
+ *
+ *   IVER T.I. S.A
+ *   Salamanca 50
+ *   46005 Valencia
+ *   Spain
+ *
+ *   +34 963163400
+ *   dac@iver.es
+ */
+
+import java.io.BufferedOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.net.ConnectException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Hashtable;
+import java.util.prefs.Preferences;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.compat.net.ICancellable;
+
+
+/**
+ * Clase con m�todos de utilidad en el protocolo WMS
+ *
+ * @authors Laura D�az, jaume dominguez faus
+ */
+public class SEDownloader implements org.gvsig.compat.net.Downloader{
+    String                  characters;
+	boolean                 canceled;
+	final long              latency    = 500;
+	private static int      count      = 0;
+	private static Logger   LOG     = LoggerFactory.getLogger(SEDownloader.class);
+	
+	/**
+	 * Used to cancel a group of files
+	 * <b>key</b>: Group id, <b>value</b>: Boolean (true if
+	 * the group has to be canceled. Otherwise it is
+	 * false)
+	 */
+	Hashtable canceledGroup = new Hashtable();
+	/**
+	 * <b>key</b>: URL, <b>value</b>: path to the downloaded file.
+	 */
+	Hashtable downloadedFiles;
+	Exception downloadException;
+	final String tempDirectoryPath = System.getProperty("java.io.tmpdir")+"/tmp-andami";
+    
+	public SEDownloader() {
+        super();  
+		characters = "";
+		for (int j = 32; j<=127; j++){
+			characters += (char) j;
+		}
+		characters += "�������������������������������������������ǡ�����\n\r\f\t��";
+	}
+	
+	/**
+	 * Return the content of a file that has been created 
+	 * from a URL using the HTTP GET protocol
+	 * @param url
+	 * The URL
+	 * @return
+	 * File containing this URL's content or null if no file was found.
+	 */
+	private File getPreviousDownloadedURL(URL url){
+		return getPreviousDownloaded(url);
+	}
+
+	/**
+	 * Return the content of a file that has been created 
+	 * from a URL using the HTTP POST protocol
+	 * @param url
+	 * The URL
+	 * @param data
+	 * The data to send on the query
+	 * @return
+	 * File containing this URL's content or null if no file was found.
+	 */
+	private File getPreviousDownloadedURL(URL url, String data) {
+		if(data == null)
+			return getPreviousDownloaded(url);
+		return getPreviousDownloaded(url + data);
+	}
+
+	/**
+	 * Returns the content of a URL as a file from the file system.<br>
+	 * <p>
+	 * If the URL has been already downloaded in this session and notified
+	 * to the system using the static <b>Utilities.addDownloadedURL(URL)</b>
+	 * method, it can be restored faster from the file system avoiding to
+	 * download it again.
+	 * </p>
+	 * @param url
+	 * @return File containing this URL's content or null if no file was found.
+	 */
+	private File getPreviousDownloaded(Object object) {
+		File f = null;
+		if (downloadedFiles != null && downloadedFiles.containsKey(object)) {
+			String filePath = (String) downloadedFiles.get(object);
+			f = new File(filePath);
+			if (!f.exists())
+				return null;
+		}
+		return f;
+	}
+
+	/**
+	 * Adds an URL to the table of downloaded files for further uses. If the URL
+	 * already exists in the table its filePath value is updated to the new one and
+	 * the old file itself is removed from the file system.
+	 *
+	 * @param url
+	 * @param filePath
+	 */
+	void addDownloadedURL(URL url, String filePath) {
+		if (downloadedFiles == null)
+			downloadedFiles = new Hashtable();
+		String fileName = (String) downloadedFiles.put(url, filePath);
+		//JMV: No se puede eliminar el anterior porque puede que alguien lo
+		// este usando
+		/*
+        if (fileName!=null){
+            File f = new File(fileName);
+            if (f.exists())
+                f.delete();
+        }
+		 */
+	}
+
+	/**
+	 * Downloads an URL into a temporary file that is removed the next time the
+	 * tempFileManager class is called, which means the next time gvSIG is launched.
+	 *
+	 * @param url
+	 * @param name
+	 * @return
+	 * @throws IOException
+	 * @throws ServerErrorResponseException
+	 * @throws ConnectException
+	 * @throws UnknownHostException
+	 */
+	public synchronized File downloadFile(URL url, String name, ICancellable cancel) throws IOException,ConnectException, UnknownHostException {
+		File f = null;
+
+		if ((f = getPreviousDownloadedURL(url)) == null) {
+			File tempDirectory = new File(tempDirectoryPath);
+			if (!tempDirectory.exists())
+				tempDirectory.mkdir();
+
+			f = new File(calculateFileName(name));
+
+			if (cancel == null) {
+				cancel = new ICancellable() {
+					public boolean isCanceled() {
+						return false;
+					}
+					public Object getID(){
+						return SEDownloader.class.getName();
+					}
+				};
+			}
+			
+			Monitor monitorObj = new Monitor(this, cancel);
+			Thread downloader = new Thread(new Downloader(this, url, f, cancel.getID()));
+			Thread monitor = new Thread(monitorObj);
+			
+			monitor.start();
+			downloader.start();
+			while(!getCanceled(cancel.getID()) && downloader.isAlive()) {
+				try {
+					Thread.sleep(latency);
+				} catch (InterruptedException e) {
+					LOG.error("Error", e);
+				}
+			}
+
+			try {
+				monitorObj.setFinish(true);
+				monitor.join();
+				downloader.join();
+			} catch (InterruptedException e1) {
+				LOG.warn(e1.getMessage());
+			}
+			downloader = null;
+			monitor = null;
+
+			if (getCanceled(cancel.getID()))
+				return null;
+			downloader = null;
+			monitor = null;
+			if (this.downloadException != null) {
+				Exception e = this.downloadException;
+				if (e instanceof FileNotFoundException)
+					throw (IOException) e;
+				else if (e instanceof IOException)
+					throw (IOException) e;
+				else if (e instanceof ConnectException)
+					throw (ConnectException) e;
+				else if (e instanceof UnknownHostException)
+					throw (UnknownHostException) e;
+			}
+		} else {
+		    LOG.info(url.toString() + " cached at '" + f.getAbsolutePath() + "'");
+		}
+
+		return f;
+	}
+	
+	private String calculateFileName(String name) {
+		count ++;
+		int index = name.lastIndexOf(".");
+		if (index > 0){
+			return tempDirectoryPath + "/" + name.substring(0,index) + System.currentTimeMillis() + count + 
+				name.substring(index, name.length());
+		}
+		return tempDirectoryPath + "/" + name + System.currentTimeMillis() + count;
+	}
+
+
+	/**
+	 * Downloads a URL using the HTTP Post protocol
+	 * @param url
+	 * The server URL
+	 * @param data
+	 * The data to send in the request
+	 * @param name
+	 * A common name for all the retrieved files
+	 * @param cancel
+	 * Used to cancel the downloads
+	 * @return
+	 * The retrieved file
+	 * @throws IOException
+	 * @throws ConnectException
+	 * @throws UnknownHostException
+	 */
+	public synchronized File downloadFile(URL url, String data, String name, ICancellable cancel) throws IOException,ConnectException, UnknownHostException{
+		File f = null;
+
+		if ((f = getPreviousDownloadedURL(url,data)) == null) {
+			File tempDirectory = new File(tempDirectoryPath);
+			if (!tempDirectory.exists())
+				tempDirectory.mkdir();
+
+			f = new File(calculateFileName(name));
+
+			if (cancel == null) {
+				cancel = new ICancellable() {
+					public boolean isCanceled() {
+						return false;
+					}
+					public Object getID(){
+						return SEDownloader.class.getName();
+					}
+				};
+			}
+			Monitor monitorObj = new Monitor(this, cancel);
+			Thread downloader = new Thread(new Downloader(this, url, data, f, cancel.getID()));
+			Thread monitor = new Thread(monitorObj);
+			monitor.start();
+			downloader.start();
+			while(!getCanceled(cancel.getID()) && downloader.isAlive()) {
+				try {
+					Thread.sleep(latency);
+				} catch (InterruptedException e) {
+					LOG.error("Error", e);
+				}
+			}
+
+			try {
+				monitorObj.setFinish(true);
+				monitor.join();
+				downloader.join();
+			} catch (InterruptedException e1) {
+				LOG.warn(e1.getMessage());
+			}
+			downloader = null;
+			monitor = null;
+
+			if (getCanceled(cancel.getID()))
+				return null;
+			if (this.downloadException!=null) {
+				Exception e = this.downloadException;
+				if (e instanceof FileNotFoundException)
+					throw (IOException) e;
+				else if (e instanceof IOException)
+					throw (IOException) e;
+				else if (e instanceof ConnectException)
+					throw (ConnectException) e;
+				else if (e instanceof UnknownHostException)
+					throw (UnknownHostException) e;
+			}
+		} else {
+			LOG.info(url.toString() + " cached at '" + f.getAbsolutePath() + "'");
+		}
+
+		return f;
+	}
+
+	/**
+	 * Try if a group of downloads has been canceled
+	 * @param groupId
+	 * Group id
+	 * @return
+	 * If the group has been canceled
+	 */
+	protected boolean getCanceled(Object groupId) {
+		Object obj = canceledGroup.get(groupId);
+		if (obj != null) {
+			return ((Boolean)obj).booleanValue();
+		}
+		return false;
+	}
+
+	/**
+	 * Cancel a group of downloads
+	 * @param groupId
+	 * Group id
+	 * @param isCanceled
+	 * if the group has to be canceled
+	 */
+	protected void setCanceled(Object groupId, boolean isCanceled) {
+		if (groupId == null) {
+			groupId = SEDownloader.class.getName();
+		}
+		canceledGroup.put(groupId,new Boolean(isCanceled));
+	}
+
+	/**
+	 * Cleans every temporal file previously downloaded.
+	 */
+	public void cleanUpTempFiles() {
+		try{
+			File tempDirectory = new File(tempDirectoryPath);
+
+			File[] files = tempDirectory.listFiles();
+			if (files!=null) {
+				for (int i = 0; i < files.length; i++) {
+					// s�lo por si en un futuro se necesitan crear directorios temporales
+					if (files[i].isDirectory())	deleteDirectory(files[i]);
+					files[i].delete();
+				}
+			}
+			tempDirectory.delete();
+		} catch (Exception e) {	}
+
+	}
+	/**
+	 * Recursive directory delete.
+	 * @param f
+	 */
+	private void deleteDirectory(File f) {
+		File[] files = f.listFiles();
+		for (int i = 0; i < files.length; i++) {
+			if (files[i].isDirectory()) 
+				deleteDirectory(files[i]);
+			files[i].delete();
+		}
+
+	}
+
+
+	/**
+	 * Remove an URL from the system cache. The file will remain in the file
+	 * system for further eventual uses.
+	 * @param request
+	 */
+	public void removeURL(URL url) {
+		if (downloadedFiles != null && downloadedFiles.containsKey(url))
+			downloadedFiles.remove(url);
+	}
+
+	/**
+	 * Remove an URL from the system cache. The file will remain in the file
+	 * system for further eventual uses.
+	 * @param request
+	 */
+	public void removeURL(Object url) {
+		if (downloadedFiles != null && downloadedFiles.containsKey(url))
+			downloadedFiles.remove(url);
+	}
+}
+
+final class Monitor implements Runnable {
+	ICancellable c;
+	private volatile boolean finish = false;
+	SEDownloader downloader;
+	private static Logger LOG = LoggerFactory.getLogger(Monitor.class);
+	
+	public Monitor(SEDownloader downloader, ICancellable cancel) {
+	    downloader.setCanceled(cancel.getID(),false);
+		this.c = cancel;
+		this.downloader = downloader;
+	}
+	
+	public void run() {
+		while (!c.isCanceled() && !getFinish()) {
+			try {
+				Thread.sleep(downloader.latency);
+			} catch (InterruptedException e) {
+				LOG.error("Error", e);
+			}
+		}
+
+		/*  WARNING!! This works because only one download is being processed at once.
+		 *  You could prefer to start several transfers simultaneously. If so, you
+		 *  should consideer using a non-static variable such is Utilities.canceled to
+		 *  control when and which transfer in particular has been canceled.
+		 *
+		 *  The feature of transfer several files is at the moment under study. We are
+		 *  planning to add an intelligent system that will give you a lot of services
+		 *  and ease-of-use. So, we encourage you to wait for it instead of write your
+		 *  own code.
+		 */
+		if(c.isCanceled())
+			downloader.setCanceled(c.getID(), true);
+	}
+	
+	public synchronized void setFinish(boolean value) { 
+		finish = value; 
+	}
+	
+	public synchronized boolean getFinish() { 
+		return finish; 
+	}
+}
+
+final class Downloader implements Runnable {
+	private URL url                    = null;
+	private File dstFile               = null;
+	private Object groupID             = null;
+	private String data                = null;
+	private SEDownloader downloader    = null;
+	private static Logger LOG       = LoggerFactory.getLogger(Downloader.class);
+	
+	public Downloader(SEDownloader downloader, URL url, File dstFile, Object groupID) {
+		this.url = url;
+		this.dstFile = dstFile;
+		this.groupID = groupID;
+		this.downloader = downloader;
+		downloader.downloadException = null;
+	}
+
+	public Downloader(SEDownloader downloader, URL url, String data, File dstFile, Object groupID) {
+		this.url = url;
+		this.data = data;
+		this.dstFile = dstFile;
+		this.groupID = groupID;	
+		this.downloader = downloader;
+		downloader.downloadException = null;
+	}
+
+	public void run() {
+		LOG.info("downloading '" + url.toString() + "' to: " + dstFile.getAbsolutePath());
+		if (data != null){
+		    LOG.info("using POST, request = " + data);
+		}
+		// getting timeout from preferences in milliseconds.
+		Preferences prefs = Preferences.userRoot().node( "gvsig.downloader" );
+		// by default 1 minute (60000 milliseconds.
+		int timeout = prefs.getInt("timeout", 60000);
+
+		DataOutputStream dos;
+		try {
+			DataInputStream is;
+			OutputStreamWriter os = null;
+			HttpURLConnection connection = null;
+			//If the used protocol is HTTPS
+			if (url.getProtocol().equals("https")) {
+				disableHttsValidation();
+			}
+			connection = (HttpURLConnection)url.openConnection();
+			connection.setConnectTimeout(timeout);
+			//If it uses a HTTP POST
+			if (data != null) {
+				connection.setRequestProperty("SOAPAction", "post");
+				connection.setRequestMethod("POST");
+				connection.setDoOutput(true);
+				connection.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");
+				os = new OutputStreamWriter(connection.getOutputStream());
+				os.write(data);
+				os.flush();	
+				is = new DataInputStream(connection.getInputStream());
+			}else{
+				is = new DataInputStream(url.openStream());
+			}
+			
+			dos = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(dstFile)));
+			byte[] buffer = new byte[1024 * 4];
+
+
+			long readed = 0;
+			for (int i = is.read(buffer); !downloader.getCanceled(groupID) && i>0; i = is.read(buffer)){
+				dos.write(buffer, 0, i);
+				readed += i;
+
+			}
+			if(os != null) {
+				os.close();
+			}
+			dos.close();
+			is.close();
+			is = null;
+			dos = null;
+			if (downloader.getCanceled(groupID)) {
+				LOG.info("[RemoteServices] '" + url + "' CANCELED.");
+				dstFile.delete();
+				dstFile = null;
+			} else {
+			    downloader.addDownloadedURL(url, dstFile.getAbsolutePath());
+			}
+		} catch (Exception e) {
+			LOG.error("Error downloading", e);
+			downloader.downloadException = e;
+		}		
+	}
+
+	/**
+	 * This method disables the Https certificate validation.
+	 * @throws KeyManagementException
+	 * @throws NoSuchAlgorithmException
+	 */
+	private void disableHttsValidation() throws KeyManagementException, NoSuchAlgorithmException{
+		// Create a trust manager that does not validate certificate chains
+		TrustManager[] trustAllCerts = new TrustManager[] {
+				new X509TrustManager() {
+					public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+						return null;
+					}
+					public void checkClientTrusted(
+							java.security.cert.X509Certificate[] certs, String authType) {
+					}
+					public void checkServerTrusted(
+							java.security.cert.X509Certificate[] certs, String authType) {
+					}
+				}
+		};
+
+		// Install the all-trusting trust manager
+		SSLContext sc = SSLContext.getInstance("SSL");
+		sc.init(null, trustAllCerts, new java.security.SecureRandom());
+		HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+	}
+}

Property changes on: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/src/org/gvsig/compat/se/net/SEDownloader.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/pom.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/pom.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/pom.xml	(revision 38333)
@@ -0,0 +1,268 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+	<!-- The Basics -->
+	<groupId>org.gvsig</groupId>
+	<artifactId>org.gvsig.compat</artifactId>
+	<version>2.0-SNAPSHOT</version>
+	<name>libCompat</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>gvsig-base-library-pom</artifactId>
+		<version>2.0-SNAPSHOT</version>
+	</parent>
+	<properties>
+		<build-dir>${basedir}/../build</build-dir>
+        <eclipse.project.name>libCompat</eclipse.project.name>
+	</properties>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+   	</dependencies>
+
+	<!-- Build Settings -->
+	<build>
+		<sourceDirectory>src</sourceDirectory>
+		<testSourceDirectory>src-test</testSourceDirectory>
+		<testResources>
+			<testResource>
+				<directory>${basedir}/resources-test</directory>
+			</testResource>
+		</testResources>
+	</build>
+
+	<profiles>
+		<profile>
+			<id>se</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-compiler-plugin</artifactId>
+						<configuration>
+							<source>1.4</source>
+							<target>1.4</target>
+							<!-- put your configurations here -->
+							<encoding>ISO-8859-1</encoding>
+						</configuration>
+					</plugin>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-jar-plugin</artifactId>
+						<configuration>
+							<excludes>
+								<exclude>**/se/**</exclude>
+							</excludes>
+						</configuration>
+
+						<executions>
+							<!-- Generates a jar file only with the libCompat SE implementation. -->
+							<execution>
+								<id>se</id>
+								<phase>package</phase>
+								<goals>
+									<goal>jar</goal>
+								</goals>
+								<configuration>
+									<classifier>se</classifier>
+									<excludes>
+										<exclude>NONE</exclude>
+									</excludes>
+									<includes>
+										<include>**/se/**</include>
+									</includes>
+								</configuration>
+							</execution>
+							<!--
+								Generates a jar file with the test, to be reused by other library
+								implementations.
+							-->
+							<execution>
+								<goals>
+									<goal>test-jar</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+					<plugin>
+						<artifactId>maven-antrun-plugin</artifactId>
+						<executions>
+							<execution>
+								<id>services</id>
+								<phase>package</phase>
+								<goals>
+									<goal>run</goal>
+								</goals>
+								<configuration>
+									<tasks>
+										<jar destfile="${project.build.directory}/${project.build.finalName}.jar"
+											update="true">
+											<fileset dir="${basedir}/resources/api" />
+										</jar>
+										<jar destfile="${project.build.directory}/${project.build.finalName}-se.jar"
+											update="true">
+											<fileset dir="${basedir}/resources/se" />
+										</jar>
+									</tasks>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-surefire-plugin</artifactId>
+						<configuration>
+							<additionalClasspathElements>
+								<additionalClasspathElement>${basedir}/resources/api</additionalClasspathElement>
+								<additionalClasspathElement>${basedir}/resources/se</additionalClasspathElement>
+							</additionalClasspathElements>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+
+		<profile>
+			<id>cdc</id>
+			<activation>
+				<activeByDefault>false</activeByDefault>
+			</activation>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-compiler-plugin</artifactId>
+						<configuration>
+							<excludes>
+								<exclude>**/se/**</exclude>
+							</excludes>
+							<testExcludes>
+								<exclude>**/se/**</exclude>
+							</testExcludes>
+						</configuration>
+					</plugin>
+
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-jar-plugin</artifactId>
+						<configuration>
+							<excludes>
+								<exclude>**/se/**</exclude>
+							</excludes>
+						</configuration>
+						<executions>
+							<!--
+								Generates a jar file only with the libCompat API. <execution>
+								<id>api</id> <phase>package</phase> <goals><goal>jar</goal></goals>
+								<configuration> <classifier>api</classifier> <excludes>
+								<exclude>**/se/**</exclude> </excludes> </configuration> </execution>
+							-->
+							<!--
+								Generates a jar file with the test, to be reused by other library
+								implementations.
+							-->
+							<execution>
+								<goals>
+									<goal>test-jar</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+					<plugin>
+						<artifactId>maven-antrun-plugin</artifactId>
+						<executions>
+							<execution>
+								<id>services</id>
+								<phase>package</phase>
+								<goals>
+									<goal>run</goal>
+								</goals>
+								<configuration>
+									<tasks>
+										<jar destfile="${project.build.directory}/${project.build.finalName}.jar"
+											update="true">
+											<fileset dir="${basedir}/resources/api" />
+										</jar>
+									</tasks>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+
+				</plugins>
+			</build>
+
+		</profile>
+		<profile>
+			<id>eclipse-project</id>
+			<build>
+				<plugins>
+					<plugin>
+						<artifactId>maven-antrun-plugin</artifactId>
+						<configuration>
+							<tasks>
+								<ant antfile="${build-dir}/ant-tasks/eclipse-tasks.xml" target="eclipse.all" />
+							</tasks>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+
+	<reporting>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<reportSets>
+					<reportSet>
+						<id>api</id>
+						<configuration>
+							<excludePackageNames>org.gvsig.compat.se</excludePackageNames>
+							<name>Javadoc: API</name>
+							<destDir>apidoc</destDir>
+							<windowtitle>API Documentation</windowtitle>
+						</configuration>
+						<reports>
+							<report>javadoc</report>
+						</reports>
+					</reportSet>
+					<reportSet>
+						<id>se-impl</id>
+						<configuration>
+							<doctitle>${project.name} ${project.version} SE
+								Implementation</doctitle>
+							<subpackages>org.gvsig.compat.se</subpackages>
+							<name>Javadoc: SE impl</name>
+							<destDir>sedoc</destDir>
+							<windowtitle>SE implementation Documentation</windowtitle>
+							<links>
+								<link>../apidoc/</link>
+							</links>
+						</configuration>
+						<reports>
+							<report>javadoc</report>
+						</reports>
+					</reportSet>
+				</reportSets>
+			</plugin>
+		</plugins>
+	</reporting>
+</project>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources/se/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources/se/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources/se/META-INF/services/org.gvsig.tools.library.Library	(revision 38333)
@@ -0,0 +1 @@
+org.gvsig.compat.se.SECompatLibrary
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources/api/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources/api/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/libCompat/libCompat/resources/api/META-INF/services/org.gvsig.tools.library.Library	(revision 38333)
@@ -0,0 +1 @@
+org.gvsig.compat.CompatLibrary
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/libraries/libCompat/libCompat
___________________________________________________________________
Added: svn:ignore
   + .classpath 
.project 
.settings 
maven-eclipse.xml
target
bin
hs_err_pid*
.externalToolBuilders
.settings
.classpath
.project


