org.geotools.referencing.factory.gridshift
Class DataUtilities

Object
  extended by DataUtilities

public class DataUtilities
extends Object

Part of DataUtilities from gt-main, which cannot be used here because of cyclic Maven dependencies.

FIXME: module dependencies should be refactored until this class does not need to exist.

Author:
Ben Caradoc-Davies (CSIRO Earth Science and Resource Engineering)

Constructor Summary
DataUtilities()
           
 
Method Summary
static URL fileToURL(File file)
          A replacement for File.toURI().toURL().
static File urlToFile(URL url)
          Copy of DataUtilities.urlToFile(URL url) in gt-main, which cannot be used here because of cyclic Maven dependencies.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataUtilities

public DataUtilities()
Method Detail

urlToFile

public static File urlToFile(URL url)
Copy of DataUtilities.urlToFile(URL url) in gt-main, which cannot be used here because of cyclic Maven dependencies.


fileToURL

public static URL fileToURL(File file)
A replacement for File.toURI().toURL().

The handling of file.toURL() is broken; the handling of file.toURI().toURL() is known to be broken on a few platforms like mac. We have the urlToFile( URL ) method that is able to untangle both these problems and we use it in the geotools library.

However occasionally we need to pick up a file and hand it to a third party library like EMF; this method performs a couple of sanity checks which we can use to prepare a good URL reference to a file in these situtations.

Parameters:
file -
Returns:
URL


Copyright © 1996-2014 Geotools. All Rights Reserved.