es.ucm.fdi.hysteria.game.parser
Class PeekFile

java.lang.Object
  extended by es.ucm.fdi.hysteria.game.parser.PeekFile

public class PeekFile
extends java.lang.Object

PeekFile determines if a given file is a Game Definition, and if it's in TXT format, XML format or SAV. It also provides with constants to use in other classes to determine the file contents.

Author:
MiniSandor

Field Summary
static int ERROR
           
static int IS_SAV
           
static int IS_TXT
           
static int IS_XML
           
 
Constructor Summary
PeekFile(java.lang.String gameDefinitionPath)
           
 
Method Summary
 java.lang.String getDirectoryPath()
           
 int getType()
           
 boolean isSav()
           
 boolean isTxt()
           
 boolean isXML()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
See Also:
Constant Field Values

IS_TXT

public static final int IS_TXT
See Also:
Constant Field Values

IS_XML

public static final int IS_XML
See Also:
Constant Field Values

IS_SAV

public static final int IS_SAV
See Also:
Constant Field Values
Constructor Detail

PeekFile

public PeekFile(java.lang.String gameDefinitionPath)
Parameters:
gameDefinitionPath - The path to the game to peek
Method Detail

getDirectoryPath

public java.lang.String getDirectoryPath()
Returns:
The path of the directory that contains this file.

getType

public int getType()
Returns:
The type of the file.

isTxt

public boolean isTxt()
Returns:
True if it's a TXT file

isXML

public boolean isXML()
Returns:
True if it's a XML file

isSav

public boolean isSav()
Returns:
True if it's a SAV file