Package crypto.rules
Class CrySLRuleReader
- java.lang.Object
-
- crypto.rules.CrySLRuleReader
-
public class CrySLRuleReader extends Object
-
-
Constructor Summary
Constructors Constructor Description CrySLRuleReader()CrySLRuleReader(CrySLModelReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CrySLRule>readFromDirectory(File directory)List<CrySLRule>readFromDirectory(File directory, boolean recursive)CrySLRulereadFromSourceFile(File file)Returns aCrySLRuleread from a single CrySL file.List<CrySLRule>readFromSourceFiles(List<File> files)Returns a list withCrySLRuleobjects from the files.List<CrySLRule>readFromZipFile(File file)
-
-
-
Constructor Detail
-
CrySLRuleReader
public CrySLRuleReader()
-
CrySLRuleReader
public CrySLRuleReader(CrySLModelReader reader)
-
-
Method Detail
-
readFromSourceFile
public CrySLRule readFromSourceFile(File file) throws CryptoAnalysisException
Returns aCrySLRuleread from a single CrySL file.- Parameters:
file- the CrySL file- Returns:
- the
CrySLRuleobject - Throws:
CryptoAnalysisException- Throws when a file could not get processed to aCrySLRule
-
readFromSourceFiles
public List<CrySLRule> readFromSourceFiles(List<File> files) throws CryptoAnalysisException
Returns a list withCrySLRuleobjects from the files.- Parameters:
files- The files to read from- Returns:
- The list with
CrySLRuleobjects - Throws:
CryptoAnalysisException- If a file could not get processed to aCrySLRule
-
readFromDirectory
public List<CrySLRule> readFromDirectory(File directory) throws CryptoAnalysisException
- Parameters:
directory- theFilewith the directory where the rules are located- Returns:
- the
ListwithCrySLRuleobjects. If no rules are found it returns an empty list. - Throws:
CryptoAnalysisException- Throws when a file could not get processed to aCrySLRule
-
readFromDirectory
public List<CrySLRule> readFromDirectory(File directory, boolean recursive) throws CryptoAnalysisException
Returns aListofCrySLRuleobjects read from a directory. In the case the directory contains further sub directories, they can also searched if the recursive argument istrue.- Parameters:
directory- theFilewith the directory where the rules are locatedrecursive-truethe subfolders will be searched too- Returns:
- the
ListwithCrySLRuleobjects. If no rules are found it returns an empty list. - Throws:
CryptoAnalysisException- Throws when a file could not get processed to aCrySLRule
-
readFromZipFile
public List<CrySLRule> readFromZipFile(File file) throws CryptoAnalysisException
- Parameters:
file- Zip that contains the CrySL files- Returns:
- the
ListwithCrySLRuleobjects. If no rules are found it returns an empty list. - Throws:
CryptoAnalysisException- If the directory is not a zip file
-
-