Package de.foellix.aql.helper
Class Helper
java.lang.Object
de.foellix.aql.helper.Helper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddZeroDigits(int id) Appends zeros to the start of the id.static StringaddZeroDigits(int id, int length) Appends zeros to the start of the id until the given string length is reached.static StringaddZeroDigits(long id) Appends zeros to the start of the id.static StringaddZeroDigits(long id, int length) Appends zeros to the start of the id until the given string length is reached.static Stringautoformat(String query) static Stringautoformat(String query, boolean breaklines) static StringcleanupParameters(String jimpleInvokeString) static booleancontains(List<IStringOrQuestion> list, String needle) Checks if needle ist contained in the given list.static Answerstatic Referencestatic intcountStringOccurences(String haystack, String needle) static Appstatic Appstatic ReferencecreateReference(String aqlQueryReference) static StatementcreateStatement(String jimpleString) static StatementcreateStatement(String jimpleString, boolean assignValues) static StatementcreateStatement(String jimpleString, boolean assignValues, int linenumber) static StatementcreateStatement(String jimpleString, int linenumber) static Stringstatic Stringstatic Stringstatic Stringstatic StringcutFromFirstToLast(String input, String fromFirst, String toLast) static StringcutFromStart(String input, String to) static StringcutFromStart(String input, String to, int toOccurence) static voidextractDataFromAuthority(String authority, Data data) static voidextractDataFromURI(String uri, Data data) static Collection<Reference>getAllReferences(Answer answer) static Collection<Reference>getAllReferences(Answer answer, boolean doubleEntriesAllowed) static List<FileWithHash>static StringgetAnswerFilesAsHash(FileWithHash answerFile) Use this method to create %ANSWERSHASH% with SHA-256static StringgetAnswerFilesAsHash(FileWithHash answerFile, String hashAlgorithm) Use this method to create %ANSWERSHASH% of any typestatic StringgetAnswerFilesAsHash(List<FileWithHash> answerFiles) Use this method to create %ANSWERSHASH% with SHA-256static StringgetAnswerFilesAsHash(List<FileWithHash> answerFiles, String hashAlgorithm) Use this method to create %ANSWERSHASH% of any typestatic StringgetAnswerFilesAsString(List<FileWithHash> answerFiles) static StringgetAppFileString(File appFile) static StringgetAppFromData(TaskInfo taskInfo) static AttributegetAttributeByName(Attributes attributes, String name) static AttributegetAttributeByName(List<Attribute> attributes, String name) static intgetCardinality(Tool tool, String operator) static ConverterTaskgetConverterParent(Task task) static StringgetDate()static StringgetDate(long timestamp) static StringgetExternalAppFiles(Task task) static StringgetExternalQuery(Task task) getExternalQueryFiles(Task task) static StringgetFeedbackFromFile(File file) Returns feedback message if given file is a feedback file.static Referencestatic Referencestatic intgetLineNumberSafe(Reference reference) static intgetLineNumberSafe(Statement statement) static StringgetMultipleApkName(String name) static longgetPreprocessorFiles(Task task) static StringgetQualifiedName(Tool tool) static String[]getRunCommandAsArray(String runCmd) static StringgetStatementfullSafe(Statement statement) static StringgetStatementgenericSafe(Statement statement) static longgetTimestamp(String dateStr, String format) static Referencestatic Referencestatic URLstatic booleanstatic booleanstatic booleanstatic FilelastFileModified(File directory) static voidmaximizeInformation(Answer answer, EqualsOptions options, boolean parametersAndLinenumbersOnly) static AnswerremoveRedundant(Answer answer, EqualsOptions options) static StringreplaceAll(String input, String needle, String replacement) Replace all no regEx!static StringreplaceAllWhiteSpaceChars(String string) static StringreplaceAllWhiteSpaceChars(String string, boolean removeTrailingWhiteSpace) static StringreplaceCustomVariables(String string, Map<String, String> customVariables) static StringreplaceDoubleSpaces(String input) static StringreplaceFirst(String input, String needle, String replacement) Replace first no regEx!static StringreplaceNull(String input, String replacement) static StringreplaceVariables(String string, Task task) static Stringstatic StringreplaceVariables(String string, Task task, Map<String, String> customVariables, boolean useHashesAndNoDate) static StringreplaceVariables(String string, Task task, Map<String, String> customVariables, boolean useHashes, boolean noDate) static StringreportMissingVariables(String string) static StringreportMissingVariables(String runCmd, Task task) static Stringstatic intstatic List<FileWithHash>toHashedFileList(List<File> answerFiles) Create a hashed file list from ordinary file liststatic List<FileWithHash>toHashedFileList(List<File> answerFiles, String hashAlgorithm) Create a hashed file list from ordinary file liststatic Stringstatic Stringstatic Stringstatic StringtoRAW(Intentsink intentsink) static StringtoRAW(Intentsource intentsource) static StringtoRAW(Permission permission) static Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic StringtoString(Attributes attributes) static Stringstatic Stringstatic Stringstatic Stringstatic StringtoString(Intentfilter intentfilter) static StringtoString(Intentfilter intentfilter, boolean detailData) static StringtoString(Intentfilters intentfilters) static StringtoString(Intentfilters intentfilters, boolean detailData) static Stringstatic Stringstatic StringtoString(Intentsink intentsink) static StringtoString(Intentsink intentsink, boolean detailData) static StringtoString(Intentsinks intentsinks) static StringtoString(Intentsinks intentsinks, boolean detailData) static StringtoString(Intentsource intentsource) static StringtoString(Intentsource intentsource, boolean detailData) static StringtoString(Intentsources intentsources) static StringtoString(Intentsources intentsources, boolean detailData) static Stringstatic StringtoString(Permission permission) static StringtoString(Permissions permissions) static Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic StringtoStringApp(App app) static StringtoStringClass(String classname) static StringtoStringMethod(String method) static StringtoStringStatement(Statement statement) static StringtoStringStatement(Statement statement, boolean replaceQuotes) static StringtoVariableName(String variableName) static StringtypeToSoi(int type)
-
Field Details
-
OCCURENCE_LAST
public static final int OCCURENCE_LAST- See Also:
-
-
Constructor Details
-
Helper
public Helper()
-
-
Method Details
-
cut
-
cutFromFirstToLast
-
cut
-
cut
-
cut
-
cutFromStart
-
cutFromStart
-
countStringOccurences
-
replaceFirst
Replace first no regEx!- Parameters:
input-needle-replacement-- Returns:
- input with needle replaced by replacement
-
replaceAll
Replace all no regEx!- Parameters:
input-needle-replacement-- Returns:
- input with needle replaced by replacement
-
soiToType
-
typeToSoi
-
copy
-
copy
-
createReference
-
createStatement
-
createStatement
-
createStatement
-
createStatement
-
getStatementfullSafe
-
getStatementgenericSafe
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toStringStatement
-
toStringStatement
-
toStringMethod
-
toStringClass
-
toStringApp
-
toRAW
-
toRAW
-
toRAW
-
toRAW
-
toRAW
-
toRAW
-
toRAW
-
toRAW
-
toRAW
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
toString
-
getQualifiedName
-
getExternalAppFiles
-
getRunCommandAsArray
-
getExternalQuery
-
getExternalQueryFiles
-
getPreprocessorFiles
-
replaceVariables
-
replaceVariables
-
replaceVariables
-
replaceVariables
-
replaceCustomVariables
-
toVariableName
-
reportMissingVariables
-
reportMissingVariables
-
getAnswerChildrenAsString
-
getAnswerFilesAsString
-
getAnswerFilesAsHash
Use this method to create %ANSWERSHASH% with SHA-256- Parameters:
answerFile- the input file- Returns:
- the hash
-
getAnswerFilesAsHash
Use this method to create %ANSWERSHASH% of any type- Parameters:
answerFile- the input file- Returns:
- the hash
-
getAnswerFilesAsHash
Use this method to create %ANSWERSHASH% with SHA-256- Parameters:
answerFiles- the input files- Returns:
- the hash
-
getAnswerFilesAsHash
Use this method to create %ANSWERSHASH% of any type- Parameters:
answerFiles- the input files- Returns:
- the hash
-
toHashedFileList
Create a hashed file list from ordinary file list- Parameters:
answerFiles-- Returns:
- the hashed file list
-
toHashedFileList
Create a hashed file list from ordinary file list- Parameters:
answerFiles-- Returns:
- the hashed file list
-
getMultipleApkName
-
getDate
-
getDate
-
getDate
-
getTimestamp
-
createApp
-
createApp
-
getAppFileString
-
getPid
-
getFrom
-
getFrom
-
getTo
-
getTo
-
removeRedundant
-
maximizeInformation
public static void maximizeInformation(Answer answer, EqualsOptions options, boolean parametersAndLinenumbersOnly) -
getCardinality
-
lastFileModified
-
replaceNull
-
extractDataFromURI
-
extractDataFromAuthority
-
isEmpty
-
isEmpty
-
isEmpty
-
getAllReferences
-
getAllReferences
-
replaceAllWhiteSpaceChars
-
replaceAllWhiteSpaceChars
-
replaceDoubleSpaces
-
getConverterParent
-
autoformat
-
autoformat
-
getAppFromData
-
getLineNumberSafe
-
getLineNumberSafe
-
contains
Checks if needle ist contained in the given list.- Parameters:
list-needle- Provide needle without "'" at start and end of the string.- Returns:
- true if contained.
-
getAttributeByName
-
getAttributeByName
-
cleanupParameters
-
getURL
-
getAllDefaultVariableNames
-
addZeroDigits
Appends zeros to the start of the id.- Parameters:
id- given id- Returns:
- the required sequence of '0's and the given id
-
addZeroDigits
Appends zeros to the start of the id.- Parameters:
id- given id- Returns:
- the required sequence of '0's and the given id
-
addZeroDigits
Appends zeros to the start of the id until the given string length is reached.- Parameters:
id- given idlength- targeted sting length- Returns:
- the required sequence of '0's and the given id
-
addZeroDigits
Appends zeros to the start of the id until the given string length is reached.- Parameters:
id- given idlength- targeted sting length- Returns:
- the required sequence of '0's and the given id
-
shorten
-
getFeedbackFromFile
Returns feedback message if given file is a feedback file. Otherwise return null.- Parameters:
file- Potential feedback file- Returns:
- feedback as String or null
-