utils
Class FileTest

java.lang.Object
  |
  +--utils.FileTest

public class FileTest
extends java.lang.Object


Field Summary
static java.lang.String conf
           
static java.lang.String log
           
static java.lang.String rep
           
static java.lang.String scf
           
static java.lang.String stf
           
 
Constructor Summary
FileTest()
           
 
Method Summary
static java.lang.String getExtension(java.io.File f)
          Method getExtension.
static boolean isExistent(java.lang.String fileName)
          Method isExistent.
static boolean isHardwareConformScenario(java.lang.String fileName, double minValue, double percent)
          Method isHardwareConformScenario.
static boolean isReadable(java.lang.String fileName)
          Method isReadable.
static boolean isValidScenarioFile(java.lang.String fwName, int columnNumber)
          Method isValidScenarioFile.
static void main(java.lang.String[] args)
          Methode: Main pour tester la classe
static java.io.FileWriter testExistent(java.lang.String fwName, boolean graphic)
          Method testExistent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scf

public static final java.lang.String scf
See Also:
Constant Field Values

stf

public static final java.lang.String stf
See Also:
Constant Field Values

conf

public static final java.lang.String conf
See Also:
Constant Field Values

log

public static java.lang.String log

rep

public static java.lang.String rep
Constructor Detail

FileTest

public FileTest()
Method Detail

getExtension

public static java.lang.String getExtension(java.io.File f)
Method getExtension. Get the extension of a file.

Parameters:
f -
Returns:
String

isReadable

public static boolean isReadable(java.lang.String fileName)
Method isReadable. Test if a file is readable or not

Parameters:
fileName -
Returns:
boolean

isExistent

public static boolean isExistent(java.lang.String fileName)
Method isExistent. Test l'existence du fichier passe en parametre

Parameters:
fileName -
Returns:
boolean

testExistent

public static java.io.FileWriter testExistent(java.lang.String fwName,
                                              boolean graphic)
                                       throws java.io.IOException
Method testExistent. Test l'existence du fichier passe en parametre Si il existe deja soit on le remplace soit on en cree un nouveau Si il n'existe pas on le cree

Parameters:
fwName -
graphic - mode text/graphic
Returns:
a FileWriter
Throws:
java.io.IOException

isValidScenarioFile

public static boolean isValidScenarioFile(java.lang.String fwName,
                                          int columnNumber)
                                   throws java.io.FileNotFoundException,
                                          java.io.IOException
Method isValidScenarioFile. It permits to test that there all the necessary data

Parameters:
fwName - name of the scenario file
columnNumber - Theoritical columns number
Returns:
boolean if it's valid or not
Throws:
java.io.FileNotFoundException
java.io.IOException

isHardwareConformScenario

public static boolean isHardwareConformScenario(java.lang.String fileName,
                                                double minValue,
                                                double percent)
                                         throws java.io.FileNotFoundException
Method isHardwareConformScenario.

Parameters:
fileName - name of the scenario to test
minValue - corresponds to the value below which we cannot generate packets with a good frequency it's in ms with a precision of nano seconds
percent - with an acceptance percentage of
Returns:
boolean
Throws:
java.io.FileNotFoundException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Methode: Main pour tester la classe

java.io.IOException