net.sf.freecol.common.io
Class FreeColModFile

java.lang.Object
  extended by net.sf.freecol.common.io.FreeColDataFile
      extended by net.sf.freecol.common.io.FreeColModFile
Direct Known Subclasses:
FreeColTcFile

public class FreeColModFile
extends FreeColDataFile

A modification.


Nested Class Summary
static class FreeColModFile.ModInfo
           
 
Field Summary
static java.lang.String[] FILE_ENDINGS
           
 
Constructor Summary
FreeColModFile(FreeColModFile.ModInfo mi)
          Opens the given file for reading.
FreeColModFile(java.lang.String id)
          Opens the given file for reading.
 
Method Summary
 java.lang.String getId()
          Gets the ID of this mod.
 FreeColModFile.ModInfo getModInfo()
           
 java.io.InputStream getSpecificationInputStream()
          Gets the input stream to the specification.
 
Methods inherited from class net.sf.freecol.common.io.FreeColDataFile
getFileFilter, getResourceMapping
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_ENDINGS

public static final java.lang.String[] FILE_ENDINGS
Constructor Detail

FreeColModFile

public FreeColModFile(java.lang.String id)
Opens the given file for reading.

Parameters:
id - The id of the mod to load.
Throws:
java.io.IOException - if thrown while opening the file.

FreeColModFile

public FreeColModFile(FreeColModFile.ModInfo mi)
Opens the given file for reading.

Parameters:
mi - An id object.
Throws:
java.io.IOException - if thrown while opening the file.
Method Detail

getSpecificationInputStream

public java.io.InputStream getSpecificationInputStream()
                                                throws java.io.IOException
Gets the input stream to the specification.

Returns:
An InputStream to the file "specification.xml" within this data file.
Throws:
java.io.IOException - if thrown while opening the input stream.

getId

public java.lang.String getId()
Gets the ID of this mod.

Returns:
The ID of the mod.

getModInfo

public FreeColModFile.ModInfo getModInfo()