uk.me.parabola.mkgmap.osmstyle
Class JarFileLoader

java.lang.Object
  extended by uk.me.parabola.mkgmap.osmstyle.StyleFileLoader
      extended by uk.me.parabola.mkgmap.osmstyle.JarFileLoader

public class JarFileLoader
extends StyleFileLoader

Load a style from a jar file. The style can just be jar'ed up at the top level or it can be contained within a directory in the jar. You can have more than one style in the jar. In this case a name will be required to select the one that you want to use. It looks for a file with a name that ends with 'version' to work out where the style is. If a name is given then it looks for a file path ending name/version.

Author:
Steve Ratcliffe

Constructor Summary
JarFileLoader(java.lang.String url, java.lang.String name)
           
JarFileLoader(java.net.URL url)
           
 
Method Summary
 void close()
          Close the FileLoader.
 java.lang.String[] list()
          List the names of the styles that are contained in this loader.
 java.io.Reader open(java.lang.String filename)
          Open the specified file in the style definition.
 
Methods inherited from class uk.me.parabola.mkgmap.osmstyle.StyleFileLoader
createStyleLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarFileLoader

public JarFileLoader(java.net.URL url)
              throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

JarFileLoader

public JarFileLoader(java.lang.String url,
                     java.lang.String name)
              throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

open

public java.io.Reader open(java.lang.String filename)
                    throws java.io.FileNotFoundException
Open the specified file in the style definition.

Specified by:
open in class StyleFileLoader
Parameters:
filename - The name of the file in the style.
Returns:
An open file reader for the file.
Throws:
java.io.FileNotFoundException - When the file can't be opened.

close

public void close()
Description copied from class: StyleFileLoader
Close the FileLoader. This is different from closing individual files that were opened via StyleFileLoader.open(java.lang.String). After this call then you shouldn't open any more files.

Specified by:
close in class StyleFileLoader

list

public java.lang.String[] list()
Description copied from class: StyleFileLoader
List the names of the styles that are contained in this loader.

Specified by:
list in class StyleFileLoader
Returns:
An array of style names.