org.geotools.data.coverage.grid.file
Class FileSystemGridCoverageExchange

java.lang.Object
  extended byorg.geotools.data.coverage.grid.file.FileSystemGridCoverageExchange
All Implemented Interfaces:
org.opengis.coverage.grid.GridCoverageExchange

public class FileSystemGridCoverageExchange
extends java.lang.Object
implements org.opengis.coverage.grid.GridCoverageExchange

A GridCoverageExchange that searches a directory (or a branch if recursive is set to true) and creates a set of catalog entries with a FileMetadata for each entry. Is both a GridCoverageExchange and a Catalog

Version:
$Revision: 1.9 $
Author:
$author$, Simone Giannecchini (simboss)

Constructor Summary
FileSystemGridCoverageExchange()
          Creates a new FileSystemGridCoverageExchange object.
FileSystemGridCoverageExchange(java.io.File root)
          Creates a FileSystemGridCoverageExchange that
 
Method Summary
 void add(org.opengis.catalog.CatalogEntry entry)
           
 void add(java.io.File f)
          Add one file to the Catalog/Exchange
 void dispose()
           
 java.util.List getFiles()
           
 org.opengis.coverage.grid.Format[] getFormats()
           
 org.opengis.coverage.grid.GridCoverageReader getReader(java.lang.Object source)
           
 org.opengis.coverage.grid.GridCoverageWriter getWriter(java.lang.Object destination, org.opengis.coverage.grid.Format format)
           
 boolean isAvailable()
           
 boolean isRecursive()
          Return true if the root and all subdirectories are searched for files
 void refresh()
          Examines the associated directories again to see if any changes have been made Not very efficient at the moment.
 void remove(org.opengis.catalog.CatalogEntry entry)
           
 boolean setDataSource(java.lang.Object datasource)
           
 void setRecursive(boolean recursive)
          Sets whether the entire branch starting at root is part of the catalog or just a single directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemGridCoverageExchange

public FileSystemGridCoverageExchange()
Creates a new FileSystemGridCoverageExchange object.


FileSystemGridCoverageExchange

public FileSystemGridCoverageExchange(java.io.File root)
Creates a FileSystemGridCoverageExchange that

Method Detail

refresh

public void refresh()
Examines the associated directories again to see if any changes have been made Not very efficient at the moment. Should be updated in the future. Each time it is called all the current are discarded and new ones are built


add

public void add(java.io.File f)
Add one file to the Catalog/Exchange

Parameters:
f - The File to be added to the catalog

getFormats

public org.opengis.coverage.grid.Format[] getFormats()
Specified by:
getFormats in interface org.opengis.coverage.grid.GridCoverageExchange
See Also:
org.geotools.gc.exchange.GridCoverageExchange#getFormats()

getReader

public org.opengis.coverage.grid.GridCoverageReader getReader(java.lang.Object source)
                                                       throws java.io.IOException
Specified by:
getReader in interface org.opengis.coverage.grid.GridCoverageExchange
Throws:
java.io.IOException
See Also:
org.geotools.gc.exchange.GridCoverageExchange#getReader(java.lang.Object)

getWriter

public org.opengis.coverage.grid.GridCoverageWriter getWriter(java.lang.Object destination,
                                                              org.opengis.coverage.grid.Format format)
                                                       throws java.io.IOException
Specified by:
getWriter in interface org.opengis.coverage.grid.GridCoverageExchange
Throws:
java.io.IOException
See Also:
org.geotools.gc.exchange.GridCoverageExchange#getWriter(java.lang.Object, org.opengis.coverage.grid.Format)

dispose

public void dispose()
             throws java.io.IOException
Specified by:
dispose in interface org.opengis.coverage.grid.GridCoverageExchange
Throws:
java.io.IOException
See Also:
org.geotools.gc.exchange.GridCoverageExchange#dispose()

add

public void add(org.opengis.catalog.CatalogEntry entry)
         throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException
See Also:
Catalog.add(org.opengis.catalog.CatalogEntry)

remove

public void remove(org.opengis.catalog.CatalogEntry entry)
            throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

isAvailable

public boolean isAvailable()
See Also:
GridCoverageExchange.isAvailable()

setDataSource

public boolean setDataSource(java.lang.Object datasource)
See Also:
org.geotools.data.coverage.grid.GridCoverageExchange#accepts(java.net.URL)

isRecursive

public boolean isRecursive()
Return true if the root and all subdirectories are searched for files

Returns:
true if the root and all subdirectories are searched for files false otherwise

setRecursive

public void setRecursive(boolean recursive)
Sets whether the entire branch starting at root is part of the catalog or just a single directory

Parameters:
recursive - True means that root and all subdirectories are searched files false means just the root is searched

getFiles

public java.util.List getFiles()


Copyright © GeoTools. All Rights Reserved.