diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Agile Software Development/TestApp/src/Parser/CssParser.java | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Master/Agile Software Development/TestApp/src/Parser/CssParser.java')
| -rw-r--r-- | Master/Agile Software Development/TestApp/src/Parser/CssParser.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Master/Agile Software Development/TestApp/src/Parser/CssParser.java b/Master/Agile Software Development/TestApp/src/Parser/CssParser.java new file mode 100644 index 0000000..9b11a1e --- /dev/null +++ b/Master/Agile Software Development/TestApp/src/Parser/CssParser.java @@ -0,0 +1,41 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package Parser; + +import testapp.data.ExternalCssItem; +import testapp.data.Item; +import java.util.logging.*; + +/** + * + * @author robb + */ +public class CssParser { + private Item rootNode; + private String srcUrl; + + public CssParser(Item rootNode) { + this.rootNode=rootNode; + } + + public ExternalCssItem parse(String url) { + // Todo: http client to recieve url and put contents into code + String code=new String(); + return parseCode(code); + } + + public ExternalCssItem parseCode(String code) { + ExternalCssItem externalCssItem=new ExternalCssItem(srcUrl,rootNode); + rootNode.add(externalCssItem); + + // check for @import and mark Suspicious + if(code.contains("@import")) { + externalCssItem.setSuspiciousCode(); + } + + return externalCssItem; + } +} |
