|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.io.FreeColDataFile
public class FreeColDataFile
Support for reading a FreeCol data file. The data file is either a ZIP-file or a directory containing certain files.
| Field Summary | |
|---|---|
private java.io.File |
file
The file this object represents. |
private static java.lang.String |
FILE_PREFIX
|
private static java.lang.String |
FILE_SUFFIX
|
private java.lang.String |
jarDirectory
A prefix string for the jar-entries (only if file is
a ZIP-file). |
private static java.util.logging.Logger |
logger
|
private static java.lang.String |
resourceScheme
A fake URI scheme for resources delegating to other resources. |
| Constructor Summary | |
|---|---|
FreeColDataFile(java.io.File file)
Opens the given file for reading. |
|
| Method Summary | |
|---|---|
private static java.lang.String |
findJarDirectory(java.lang.String expectedName,
java.io.File file)
Finds the directory within the zip-file in case the data file has been renamed. |
protected java.lang.String[] |
getFileEndings()
File endings that are supported for this type of data file. |
java.io.FileFilter |
getFileFilter()
Returns a FileFilter. |
static java.util.List<java.lang.String> |
getFileNames(java.lang.String prefix,
java.lang.String suffix,
java.lang.String language,
java.lang.String country,
java.lang.String variant)
Returns a list containing the names of all message files to load. |
java.io.BufferedInputStream |
getInputStream(java.lang.String filename)
Returns an input stream for the specified resource. |
ResourceMapping |
getResourceMapping()
Creates a ResourceMapping from the available
resource files. |
protected java.net.URI |
getURI(java.lang.String filename)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private static final java.lang.String FILE_PREFIX
private static final java.lang.String FILE_SUFFIX
private static final java.lang.String resourceScheme
private final java.io.File file
private final java.lang.String jarDirectory
file is
a ZIP-file).
| Constructor Detail |
|---|
public FreeColDataFile(java.io.File file)
file - The file to be read.| Method Detail |
|---|
private static java.lang.String findJarDirectory(java.lang.String expectedName,
java.io.File file)
expectedName - The name the directory should have.file - The zip-file.
public static java.util.List<java.lang.String> getFileNames(java.lang.String prefix,
java.lang.String suffix,
java.lang.String language,
java.lang.String country,
java.lang.String variant)
prefix - a String valuesuffix - a String valuelanguage - a String valuecountry - a String valuevariant - a String value
List value
public java.io.BufferedInputStream getInputStream(java.lang.String filename)
throws java.io.IOException
filename - The filename of a resource within this collection of
data. If this object represents a directory then the provided filename
should be relative towards the path of the directory. In case
of a compressed archive it should be the path within the
archive.
InputStream value
java.io.IOException - if an error occursprotected java.net.URI getURI(java.lang.String filename)
public ResourceMapping getResourceMapping()
ResourceMapping from the available
resource files.
ResourceMapping or null
there is no resource mapping file.public java.io.FileFilter getFileFilter()
FileFilter.
FileFilter.protected java.lang.String[] getFileEndings()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||