svn commit: r1487401 - in /sis/branches/JDK7: ./ core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java pom.xml src/site/resources/images/banner.png src/site/site.xml
Author: desruisseaux Date: Wed May 29 08:33:51 2013 New Revision: 1487401 URL: http://svn.apache.org/r1487401 Log: Merge from trunk, and fixed URL to the site. Added: sis/branches/JDK7/src/site/resources/images/banner.png - copied unchanged from r1487399, sis/trunk/src/site/resources/images/banner.png Modified: sis/branches/JDK7/ (props changed) sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java sis/branches/JDK7/pom.xml sis/branches/JDK7/src/site/site.xml Propchange: sis/branches/JDK7/ -- Merged /sis/trunk:r1487001-1487399 Modified: sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java?rev=1487401&r1=1487400&r2=1487401&view=diff == --- sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java [UTF-8] Wed May 29 08:33:51 2013 @@ -33,7 +33,7 @@ public final class WebSite extends Inlin /** * URL to the web site, without trailing slash. */ -static final String URL = "http://builds.apache.org/job/sis-trunk/site";; +static final String URL = "http://builds.apache.org/job/sis-jdk7/site";; /** * Register this taglet. Modified: sis/branches/JDK7/pom.xml URL: http://svn.apache.org/viewvc/sis/branches/JDK7/pom.xml?rev=1487401&r1=1487400&r2=1487401&view=diff == --- sis/branches/JDK7/pom.xml (original) +++ sis/branches/JDK7/pom.xml Wed May 29 08:33:51 2013 @@ -78,7 +78,7 @@ Apache SIS is a free software, Java lang jenkins -https://builds.apache.org/job/sis-trunk +https://builds.apache.org/job/sis-jdk7 Modified: sis/branches/JDK7/src/site/site.xml URL: http://svn.apache.org/viewvc/sis/branches/JDK7/src/site/site.xml?rev=1487401&r1=1487400&r2=1487401&view=diff == --- sis/branches/JDK7/src/site/site.xml (original) +++ sis/branches/JDK7/src/site/site.xml Wed May 29 08:33:51 2013 @@ -29,7 +29,8 @@ --> Apache SIS -http://builds.apache.org/job/sis-trunk/site/index.html +http://builds.apache.org/job/sis-jdk7/site/images/banner.png +http://builds.apache.org/job/sis-jdk7/site/index.html @@ -42,7 +43,7 @@ http://www.apache.org"/> http://www.opengeospatial.org"/> http://www.geoapi.org"/> - http://builds.apache.org/job/sis-trunk/site/apidocs/index.html"/> + http://builds.apache.org/job/sis-jdk7/site/apidocs/index.html"/>
svn commit: r1487410 - in /sis/branches/JDK7: core/sis-build-helper/src/site/site.xml core/sis-metadata/src/site/site.xml core/sis-utility/src/site/site.xml core/src/site/site.xml src/site/site.xml
Author: desruisseaux Date: Wed May 29 08:58:52 2013 New Revision: 1487410 URL: http://svn.apache.org/r1487410 Log: Updated site descriptor XSD. Modified: sis/branches/JDK7/core/sis-build-helper/src/site/site.xml sis/branches/JDK7/core/sis-metadata/src/site/site.xml sis/branches/JDK7/core/sis-utility/src/site/site.xml sis/branches/JDK7/core/src/site/site.xml sis/branches/JDK7/src/site/site.xml Modified: sis/branches/JDK7/core/sis-build-helper/src/site/site.xml URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-build-helper/src/site/site.xml?rev=1487410&r1=1487409&r2=1487410&view=diff == --- sis/branches/JDK7/core/sis-build-helper/src/site/site.xml (original) +++ sis/branches/JDK7/core/sis-build-helper/src/site/site.xml Wed May 29 08:58:52 2013 @@ -19,10 +19,10 @@ under the License. --> -http://maven.apache.org/DECORATION/1.0.0"; +http://maven.apache.org/DECORATION/1.3.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 - http://maven.apache.org/xsd/decoration-1.0.0.xsd";> + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 + http://maven.apache.org/xsd/decoration-1.3.0.xsd";> -http://maven.apache.org/DECORATION/1.0.0"; +http://maven.apache.org/DECORATION/1.3.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 - http://maven.apache.org/xsd/decoration-1.0.0.xsd";> + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 + http://maven.apache.org/xsd/decoration-1.3.0.xsd";> -http://maven.apache.org/DECORATION/1.0.0"; +http://maven.apache.org/DECORATION/1.3.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 - http://maven.apache.org/xsd/decoration-1.0.0.xsd";> + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 + http://maven.apache.org/xsd/decoration-1.3.0.xsd";> -http://maven.apache.org/DECORATION/1.0.0"; +http://maven.apache.org/DECORATION/1.3.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 - http://maven.apache.org/xsd/decoration-1.0.0.xsd";> + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 + http://maven.apache.org/xsd/decoration-1.3.0.xsd";> -http://maven.apache.org/DECORATION/1.0.0"; +http://maven.apache.org/DECORATION/1.3.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; - xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 - http://maven.apache.org/xsd/decoration-1.0.0.xsd";> + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 + http://maven.apache.org/xsd/decoration-1.3.0.xsd";>
svn commit: r1487421 - in /sis/branches/JDK7/storage: sis-netcdf/src/site/ sis-storage/src/site/ sis-storage/src/site/apt/ sis-storage/src/site/resources/ sis-storage/src/site/resources/css/ src/site/
Author: desruisseaux Date: Wed May 29 09:18:53 2013 New Revision: 1487421 URL: http://svn.apache.org/r1487421 Log: Complete site descriptors for storage modules. Added: sis/branches/JDK7/storage/sis-netcdf/src/site/site.xml - copied, changed from r1487410, sis/branches/JDK7/core/sis-utility/src/site/site.xml sis/branches/JDK7/storage/sis-storage/src/site/ sis/branches/JDK7/storage/sis-storage/src/site/apt/ sis/branches/JDK7/storage/sis-storage/src/site/apt/index.apt - copied, changed from r1487410, sis/branches/JDK7/storage/sis-netcdf/src/site/apt/index.apt sis/branches/JDK7/storage/sis-storage/src/site/resources/ sis/branches/JDK7/storage/sis-storage/src/site/resources/css/ sis/branches/JDK7/storage/sis-storage/src/site/resources/css/site.css (with props) sis/branches/JDK7/storage/sis-storage/src/site/site.xml - copied, changed from r1487410, sis/branches/JDK7/core/sis-utility/src/site/site.xml sis/branches/JDK7/storage/src/site/site.xml - copied, changed from r1487410, sis/branches/JDK7/core/src/site/site.xml Copied: sis/branches/JDK7/storage/sis-netcdf/src/site/site.xml (from r1487410, sis/branches/JDK7/core/sis-utility/src/site/site.xml) URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/site/site.xml?p2=sis/branches/JDK7/storage/sis-netcdf/src/site/site.xml&p1=sis/branches/JDK7/core/sis-utility/src/site/site.xml&r1=1487410&r2=1487421&rev=1487421&view=diff == --- sis/branches/JDK7/core/sis-utility/src/site/site.xml (original) +++ sis/branches/JDK7/storage/sis-netcdf/src/site/site.xml Wed May 29 09:18:53 2013 @@ -24,9 +24,9 @@ xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd";> - + Copied: sis/branches/JDK7/storage/sis-storage/src/site/apt/index.apt (from r1487410, sis/branches/JDK7/storage/sis-netcdf/src/site/apt/index.apt) URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/site/apt/index.apt?p2=sis/branches/JDK7/storage/sis-storage/src/site/apt/index.apt&p1=sis/branches/JDK7/storage/sis-netcdf/src/site/apt/index.apt&r1=1487410&r2=1487421&rev=1487421&view=diff == --- sis/branches/JDK7/storage/sis-netcdf/src/site/apt/index.apt [UTF-8] (original) +++ sis/branches/JDK7/storage/sis-storage/src/site/apt/index.apt [UTF-8] Wed May 29 09:18:53 2013 @@ -1,33 +1,8 @@ - -- - Apache SIS NetCDF storage - -- + --- + Apache SIS storage base + --- -Apache SIS NetCDF storage +Apache SIS storage base - Bridge between NetCDF Climate and Forecast (CF) convention and ISO 19115 metadata. - - NetCDF files can be read and written by the {{{http://www.unidata.ucar.edu/software/netcdf-java/}UCAR NetCDF library}} - among others. The <<>> module uses the UCAR library for fetching attribute values and information about - coordinate systems, then associates those attribute to the corresponding elements in the ISO 19115 specification. - - -* Note on the definition of terms - - The UCAR library sometime uses the same words than the ISO/OGC standards for different things. - In particular the words "" and "" can be applied to arbitrary functions, and the - UCAR library chooses to apply it to the function that converts grid indices to geodetic coordinates. - The ISO 19123 standard on the other hand considers coverage as a function, and applies those - and words to that function. More specifically: - -* UCAR "" is actually a mix of , - and in OGC sense. - -* UCAR coordinate system "" is not equivalent to ISO 19123 coverage domain, - but is rather related to . - -* ISO 19123 coverage is related to UCAR coordinate system "". - -* ISO 19123 coverage is not equivalent to UCAR "", but is rather related to the - NetCDF variable's minimum and maximum values. - - Care must be taken for avoiding confusion when using SIS and UCAR libraries together. + Provides the interfaces and base classes to be implemented by various storage formats. + The main interface provided in this module is <<>>. Added: sis/branches/JDK7/storage/sis-storage/src/site/resources/css/site.css URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/site/resources/css/site.css?rev=1487421&view=auto == --- sis/branches/JDK7/storage/sis-storage/src/site/resources/css/site.css (added) +++ sis/branches/JDK7/storage/sis-storage/src/site/resources/css/si
svn commit: r1487428 - in /sis/branches/JDK7/storage/sis-storage: pom.xml src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java
Author: desruisseaux Date: Wed May 29 10:04:32 2013 New Revision: 1487428 URL: http://svn.apache.org/r1487428 Log: Minor documentation updates. Modified: sis/branches/JDK7/storage/sis-storage/pom.xml sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java Modified: sis/branches/JDK7/storage/sis-storage/pom.xml URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/pom.xml?rev=1487428&r1=1487427&r2=1487428&view=diff == --- sis/branches/JDK7/storage/sis-storage/pom.xml (original) +++ sis/branches/JDK7/storage/sis-storage/pom.xml Wed May 29 10:04:32 2013 @@ -42,7 +42,7 @@ -DataStore API and base storage classes. +Provides the interfaces and base classes to be implemented by various storage formats. Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java?rev=1487428&r1=1487427&r2=1487428&view=diff == --- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java [UTF-8] (original) +++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java [UTF-8] Wed May 29 10:04:32 2013 @@ -458,6 +458,9 @@ loop: while ((c = read()) >= 0) { * Attempting to {@linkplain #seek(long) seek} to an offset within the flushed * portion of the stream will result in an {@link IndexOutOfBoundsException}. * + * This method moves the data starting at the given position to the beginning of the {@link #buffer}, + * thus making more room for new data before the data at the given position is discarded. + * * @param position The length of the stream prefix that may be flushed. * @throws IOException If an I/O error occurred. */ @@ -478,24 +481,25 @@ loop: while ((c = read()) >= 0) { } /** - * Returns {@code true} if this {@code ImageInputStream} caches data itself in order to - * allow {@linkplain #seek(long) seeking} backwards. - * - * @return {@code true} If this {@code ImageInputStream} caches data. + * Synonymous of {@link #isCachedMemory()} since the caching behavior of this class is uniquely determined + * by the policy that we choose for {@code isCachedMemory()}. This class never creates temporary files. * * @see #isCachedMemory() * @see #isCachedFile() */ @Override public final boolean isCached() { -return false; +return isCachedMemory(); } /** - * Returns {@code true} if this {@code ImageInputStream} caches data itself in order to - * allow {@linkplain #seek(long) seeking} backwards, and the cache is kept in main memory. + * Returns {@code false} since this {@code ImageInputStream} does not cache data itself in order to + * allow {@linkplain #seek(long) seeking} backwards. Actually, we could consider the {@link #buffer} + * as a cache in main memory. But this buffer has a maximal capacity, which would be a violation of + * {@code ImageInputStream} contract. * - * @return {@code true} if this {@code ImageInputStream} caches data in main memory. + * @return {@code false} since this {@code ImageInputStream} does not caches data in main memory + * (ignoring the {@link #buffer}). */ @Override public final boolean isCachedMemory() { @@ -503,10 +507,9 @@ loop: while ((c = read()) >= 0) { } /** - * Returns {@code true} if this {@code ImageInputStream} caches data itself in order to allow - * {@linkplain #seek(long) seeking} backwards, and the cache is kept in a temporary file. + * Returns {@code false} since this {@code ImageInputStream} does not cache data in a temporary file. * - * @return {@code true} if this {@code ImageInputStream} caches data in a temporary file. + * @return {@code false} since this {@code ImageInputStream} does not cache data in a temporary file. */ @Override public final boolean isCachedFile() {
svn commit: r1487429 - /sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java
Author: desruisseaux Date: Wed May 29 10:11:12 2013 New Revision: 1487429 URL: http://svn.apache.org/r1487429 Log: Discard obolete marks. Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java?rev=1487429&r1=1487428&r2=1487429&view=diff == --- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java [UTF-8] (original) +++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelImageInputStream.java [UTF-8] Wed May 29 10:11:12 2013 @@ -88,10 +88,10 @@ public class ChannelImageInputStream ext */ private static final class Mark { final long position; -final int bitOffset; -final Mark next; +final byte bitOffset; +Mark next; -Mark(long position, int bitOffset, Mark next) { +Mark(long position, byte bitOffset, Mark next) { this.position = position; this.bitOffset = bitOffset; this.next = next; @@ -418,7 +418,7 @@ loop: while ((c = read()) >= 0) { */ @Override public final void mark() { -mark = new Mark(getStreamPosition(), getBitOffset(), mark); +mark = new Mark(getStreamPosition(), (byte) getBitOffset(), mark); } /** @@ -478,6 +478,20 @@ loop: while ((c = read()) >= 0) { buffer.position(n); // Number of bytes to forget. buffer.compact().position(p).limit(r); setStreamPosition(currentPosition); + +// Discard obolete marks. +Mark parent = null; +for (Mark m = mark; m != null; m = m.next) { +if (m.position < position) { +if (parent != null) { +parent.next = null; +} else { +mark = null; +} +break; +} +parent = m; +} } /**
svn commit: r1487436 - in /sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis: test/TestUtilities.java util/NumbersTest.java
Author: desruisseaux Date: Wed May 29 10:41:48 2013 New Revision: 1487436 URL: http://svn.apache.org/r1487436 Log: Uses only StrictMath in tests, as a matter of principle. Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java?rev=1487436&r1=1487435&r2=1487436&view=diff == --- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java [UTF-8] Wed May 29 10:41:48 2013 @@ -138,7 +138,7 @@ public final strictfp class TestUtilitie * @return A new random number generator initialized with a random seed. */ public static Random createRandomNumberGenerator(final String testMethod) { -final long seed = Math.round(Math.random() * (1L << 48)); +final long seed = StrictMath.round(StrictMath.random() * (1L << 48)); final PrintWriter out = TestCase.out; out.print("Random number generator for “"); out.print(testMethod); Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java?rev=1487436&r1=1487435&r2=1487436&view=diff == --- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java [UTF-8] Wed May 29 10:41:48 2013 @@ -161,7 +161,7 @@ public final class NumbersTest extends T assertEquals(Integer.class, narrowestClass(-10 )); assertEquals(Integer.class, narrowestClass((double) (1L << 30))); assertEquals(Float .class, narrowestClass((double) (1L << 40))); -assertEquals(Double .class, narrowestClass(Math.PI)); +assertEquals(Double .class, narrowestClass(StrictMath.PI)); } /** @@ -169,16 +169,16 @@ public final class NumbersTest extends T */ @Test public void testNarrowestNumber() { -assertEquals(Byte .valueOf((byte) 127), narrowestNumber( 127.0)); -assertEquals(Short .valueOf((short) 128), narrowestNumber( 128.0)); -assertEquals(Integer.valueOf( 10), narrowestNumber( 10.0)); -assertEquals(Float .valueOf( 10.5f), narrowestNumber( 10.5)); -assertEquals(Byte .valueOf((byte) -128), narrowestNumber( -128 )); -assertEquals(Short .valueOf((short) -129), narrowestNumber( -129 )); -assertEquals(Integer.valueOf( -10), narrowestNumber(-10 )); -assertEquals(Integer.valueOf(1 << 30), narrowestNumber((double) (1L << 30))); -assertEquals(Float .valueOf(1L << 40), narrowestNumber((double) (1L << 40))); -assertEquals(Double .valueOf(Math.PI), narrowestNumber(Math.PI)); +assertEquals(Byte .valueOf((byte) 127), narrowestNumber( 127.0)); +assertEquals(Short .valueOf((short) 128), narrowestNumber( 128.0)); +assertEquals(Integer.valueOf( 10), narrowestNumber( 10.0)); +assertEquals(Float .valueOf( 10.5f), narrowestNumber( 10.5)); +assertEquals(Byte .valueOf((byte) -128), narrowestNumber( -128 )); +assertEquals(Short .valueOf((short) -129), narrowestNumber( -129 )); +assertEquals(Integer.valueOf( -10), narrowestNumber(-10 )); +assertEquals(Integer.valueOf(1 << 30), narrowestNumber((double) (1L << 30))); +assertEquals(Float .valueOf(1L << 40), narrowestNumber((double) (1L << 40))); +assertEquals(Double .valueOf(StrictMath.PI), narrowestNumber(StrictMath.PI)); } /**
svn commit: r1487437 - /sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java
Author: desruisseaux Date: Wed May 29 10:44:20 2013 New Revision: 1487437 URL: http://svn.apache.org/r1487437 Log: Missing strictfp in test. Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java?rev=1487437&r1=1487436&r2=1487437&view=diff == --- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/NumbersTest.java [UTF-8] Wed May 29 10:44:20 2013 @@ -31,7 +31,7 @@ import static org.apache.sis.util.Number * @version 0.3 * @module */ -public final class NumbersTest extends TestCase { +public final strictfp class NumbersTest extends TestCase { /** * Tests {@link Numbers#isInteger(Class)}. */
svn commit: r1487611 - in /sis/branches/JDK7: core/sis-utility/src/main/java/org/apache/sis/util/ storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ storage/sis-storage/src/test/java/o
Author: desruisseaux Date: Wed May 29 19:41:45 2013 New Revision: 1487611 URL: http://svn.apache.org/r1487611 Log: Ported IOUtilities internal methods. Added: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java (with props) sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/IOUtilitiesTest.java (with props) Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java?rev=1487611&r1=1487610&r2=1487611&view=diff == --- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java [UTF-8] Wed May 29 19:41:45 2013 @@ -110,7 +110,7 @@ public final class Exceptions extends St * {@linkplain Throwable#getLocalizedMessage() localized message} of the given exception * on the next line. If the exception has a {@linkplain Throwable#getCause() causes}, then * the localized message of the cause is formatted on the next line and the process is - * repeated for the whole cause chain. + * repeated for the whole cause chain, omitting duplicated messages. * * {@link SQLException} is handled especially in order to process the * {@linkplain SQLException#getNextException() next exception} instead than the cause. Added: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java?rev=1487611&view=auto == --- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java (added) +++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java [UTF-8] Wed May 29 19:41:45 2013 @@ -0,0 +1,404 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.internal.storage; + +import java.util.Locale; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.IOException; +import java.net.URI; +import java.net.URL; +import java.net.URLDecoder; +import java.net.URISyntaxException; +import java.net.MalformedURLException; +import java.nio.file.Path; +import java.nio.file.Files; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; +import java.nio.charset.StandardCharsets; +import java.nio.file.FileSystemNotFoundException; +import java.nio.file.Paths; +import org.apache.sis.util.CharSequences; +import org.apache.sis.util.Exceptions; +import org.apache.sis.util.Static; +import org.apache.sis.util.resources.Errors; + + +/** + * Utility methods related to I/O operations. Many methods in this class accept arbitrary {@link Object} argument + * and perform a sequence of {@code instanceof} checks. Since this approach provides no type safety and since the + * sequence of {@code instanceof} checks is somewhat arbitrary, those methods can not be in public API. + * + * Unless otherwise specified, giving an instance of unknown type or a {@code null} value cause the methods to + * return {@code null}. No exception is thrown for unknown type - callers must check that the return value is not + * null. However exceptions may be thrown for malformed URI or URL. + * + * @author Martin Desruisseaux (Geomatys) + * @author Johann Sorel (Geomatys) + * @since 0.3 (derived from geotk-3.00) + * @version 0.3 + * @module + */ +public final class IOUtilities extends Static { +/** + * Do not allow instantiation of this class. + */ +private IOUtilities() { +} + +/