org.openstreetmap.josm.io.session
Class SessionReader.ImportSupport

java.lang.Object
  extended by org.openstreetmap.josm.io.session.SessionReader.ImportSupport
Enclosing class:
SessionReader

public class SessionReader.ImportSupport
extends java.lang.Object


Field Summary
private  java.lang.String inZipPath
          Path of the file inside the zip archive.
private  java.util.LinkedHashMap<java.lang.Integer,SessionLayerImporter> layerDependencies
           
private  int layerIndex
           
private  java.lang.String layerName
           
 
Constructor Summary
SessionReader.ImportSupport(java.lang.String layerName, int layerIndex, java.util.LinkedHashMap<java.lang.Integer,SessionLayerImporter> layerDependencies)
           
 
Method Summary
 void addPostLayersTask(java.lang.Runnable task)
          Add a task, e.g.
 java.io.File getFile(java.lang.String uriStr)
          Return a File for a URI from a .jos/.joz file.
 java.io.InputStream getInputStream(java.lang.String uriStr)
          Return an InputStream for a URI from a .jos/.joz file.
 java.util.LinkedHashMap<java.lang.Integer,SessionLayerImporter> getLayerDependencies()
          Dependencies - maps the layer index to the importer of the given layer.
 int getLayerIndex()
          Index of the layer that is currently imported.
 java.lang.String getLayerName()
          Name of the layer that is currently imported.
 boolean isZip()
          Returns true if we are reading from a .joz file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layerName

private java.lang.String layerName

layerIndex

private int layerIndex

layerDependencies

private java.util.LinkedHashMap<java.lang.Integer,SessionLayerImporter> layerDependencies

inZipPath

private java.lang.String inZipPath
Path of the file inside the zip archive. Used as alternative return value for getFile method.

Constructor Detail

SessionReader.ImportSupport

public SessionReader.ImportSupport(java.lang.String layerName,
                                   int layerIndex,
                                   java.util.LinkedHashMap<java.lang.Integer,SessionLayerImporter> layerDependencies)
Method Detail

addPostLayersTask

public void addPostLayersTask(java.lang.Runnable task)
Add a task, e.g. a message dialog, that should be executed in EDT after all layers have been added.


getInputStream

public java.io.InputStream getInputStream(java.lang.String uriStr)
                                   throws java.io.IOException
Return an InputStream for a URI from a .jos/.joz file. The following forms are supported: - absolute file (both .jos and .joz): "file:///home/user/data.osm" "file:/home/user/data.osm" "file:///C:/files/data.osm" "file:/C:/file/data.osm" "/home/user/data.osm" "C:\files\data.osm" (not a URI, but recognized by File constructor on Windows systems) - standalone .jos files: - relative uri: "save/data.osm" "../project2/data.osm" - for .joz files: - file inside zip archive: "layers/01/data.osm" - relativ to the .joz file: "../save/data.osm" ("../" steps out of the archive)

Throws:
java.io.IOException - Thrown when no Stream can be opened for the given URI, e.g. when the linked file has been deleted.

getFile

public java.io.File getFile(java.lang.String uriStr)
                     throws java.io.IOException
Return a File for a URI from a .jos/.joz file. Returns null if the URI points to a file inside the zip archive. In this case, inZipPath will be set to the corresponding path.

Throws:
java.io.IOException

isZip

public boolean isZip()
Returns true if we are reading from a .joz file.


getLayerName

public java.lang.String getLayerName()
Name of the layer that is currently imported.


getLayerIndex

public int getLayerIndex()
Index of the layer that is currently imported.


getLayerDependencies

public java.util.LinkedHashMap<java.lang.Integer,SessionLayerImporter> getLayerDependencies()
Dependencies - maps the layer index to the importer of the given layer. All the dependent importers have loaded completely at this point.



JOSM