org.geotools.data.shapefile
Class Lock

java.lang.Object
  extended byorg.geotools.data.shapefile.Lock

public class Lock
extends java.lang.Object

A read-write lock for shapefiles so that OS file locking exceptions will not ruin an attempt to update a shapefile. On windows there are often operating system locking conflicts when writing to a shapefile. In order to not have exceptions thrown everytime a write is made, geotools has implemented file locking for shapefiles.

Author:
jeichar

Constructor Summary
Lock()
           
 
Method Summary
 void lockRead()
          Called by shapefileReader before a read is started and before an IOStream is openned.
 void lockWrite()
          Called by ShapefileDataStore before a write is started and before an IOStream is openned.
 void unlockRead()
          Called by ShapefileReader after a read is complete and after the IOStream is closed.
 void unlockWrite()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lock

public Lock()
Method Detail

lockRead

public void lockRead()
              throws java.io.IOException
Called by shapefileReader before a read is started and before an IOStream is openned.

Throws:
java.io.IOException

unlockRead

public void unlockRead()
Called by ShapefileReader after a read is complete and after the IOStream is closed.


lockWrite

public void lockWrite()
               throws java.io.IOException
Called by ShapefileDataStore before a write is started and before an IOStream is openned.

Throws:
java.io.IOException

unlockWrite

public void unlockWrite()


Copyright © GeoTools. All Rights Reserved.