Package crypto.cryslhandler
Class CrySLModelReader
- java.lang.Object
-
- crypto.cryslhandler.CrySLModelReader
-
public class CrySLModelReader extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringcryslFileEnding
-
Constructor Summary
Constructors Constructor Description CrySLModelReader()Creates a CrySLModelReader which creates rules from classes on the runtime's classpath.CrySLModelReader(CrySLModelReaderClassPath classPath)Creates a CrySLModelReader which creates rules from classes on the runtime's classpath and a given virtual classpath.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringfilterQuotes(String dirty)CrySLRulereadRule(File ruleFile)Reads the content of a CrySL file and returns aCrySLRuleobject.CrySLRulereadRule(InputStream stream, String virtualFileName)Reads the content of a CrySL file from anInputStream, afterwards theCrySLRulewill be created.Collection<CrySLRule>readRulesFromFiles(Collection<File> files)Read the crysl rules from all given files.
-
-
-
Field Detail
-
cryslFileEnding
public static final String cryslFileEnding
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CrySLModelReader
public CrySLModelReader()
Creates a CrySLModelReader which creates rules from classes on the runtime's classpath.
-
CrySLModelReader
public CrySLModelReader(CrySLModelReaderClassPath classPath)
Creates a CrySLModelReader which creates rules from classes on the runtime's classpath and a given virtual classpath.- Parameters:
classPath- Contains additional classpath elements which are not present on the current runtime's classpath.
-
-
Method Detail
-
readRulesFromFiles
public Collection<CrySLRule> readRulesFromFiles(Collection<File> files)
Read the crysl rules from all given files.- Parameters:
files- a list of files to read from- Returns:
- the list with the parsed CrySLRules
-
readRule
public CrySLRule readRule(InputStream stream, String virtualFileName) throws IOException, CryptoAnalysisException
Reads the content of a CrySL file from anInputStream, afterwards theCrySLRulewill be created.- Parameters:
stream- theInputStreamholds the CrySL file contentvirtualFileName- the name needs following structure [HexHashedAbsoluteZipFilePath][SystemFileSeparator][ZipEntryName]- Returns:
- the
CrySLRule - Throws:
IllegalArgumentException- If the file for the rule cannot be foundIOException- If there is a problem with reading the fileCryptoAnalysisException- If the file is not a .crysl file
-
readRule
public CrySLRule readRule(File ruleFile) throws CryptoAnalysisException
Reads the content of a CrySL file and returns aCrySLRuleobject.- Parameters:
ruleFile- the CrySL file- Returns:
- the
CrySLRuleobject - Throws:
CryptoAnalysisException- If the file is not a .crysl file
-
-