Skip to content

Commit 83673f0

Browse files
fixed formatting
1 parent c4cc376 commit 83673f0

File tree

12 files changed

+838
-453
lines changed

12 files changed

+838
-453
lines changed

.vscode/java-formatter.xml

+382
Large diffs are not rendered by default.

.vscode/settings.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "interactive",
3+
// number of spaces for a tab
4+
"editor.tabSize": 2,
5+
6+
// insert spaces when pressing tab
7+
"editor.insertSpaces": true,
8+
"java.format.settings.url": ".vscode/java-formatter.xml",
9+
"[java]": {
10+
"editor.detectIndentation": false
11+
}
12+
13+
}

src/main/java/de/martinspielmnann/nmapxmlparser/NmapParserException.java

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
public class NmapParserException extends Exception {
44

5-
private static final long serialVersionUID = 1L;
5+
private static final long serialVersionUID = 1L;
66

7-
public NmapParserException() {
8-
super();
9-
}
7+
public NmapParserException() {
8+
super();
9+
}
1010

11-
public NmapParserException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
12-
super(message, cause, enableSuppression, writableStackTrace);
13-
}
11+
public NmapParserException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
12+
super(message, cause, enableSuppression, writableStackTrace);
13+
}
1414

15-
public NmapParserException(String message, Throwable cause) {
16-
super(message, cause);
17-
}
15+
public NmapParserException(String message, Throwable cause) {
16+
super(message, cause);
17+
}
1818

19-
public NmapParserException(String message) {
20-
super(message);
21-
}
19+
public NmapParserException(String message) {
20+
super(message);
21+
}
2222

23-
public NmapParserException(Throwable cause) {
24-
super(cause);
25-
}
23+
public NmapParserException(Throwable cause) {
24+
super(cause);
25+
}
2626

2727
}

src/main/java/de/martinspielmnann/nmapxmlparser/NmapXmlParser.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313

1414
public class NmapXmlParser {
1515

16-
public NmapRun parse(Path pathToXml) throws IOException, NmapParserException {
17-
return parse(Files.readString(pathToXml));
18-
}
19-
20-
public NmapRun parse(String xmlAsString) throws NmapParserException {
21-
try {
22-
return XmlParser.parse(xmlAsString);
23-
} catch (ParserConfigurationException | SAXException | IOException e) {
24-
throw new NmapParserException(String.format("Error parsing [%s]", xmlAsString), e);
25-
}
26-
}
16+
public NmapRun parse(Path pathToXml) throws IOException, NmapParserException {
17+
return parse(Files.readString(pathToXml));
18+
}
19+
20+
public NmapRun parse(String xmlAsString) throws NmapParserException {
21+
try {
22+
return XmlParser.parse(xmlAsString);
23+
} catch (ParserConfigurationException | SAXException | IOException e) {
24+
throw new NmapParserException(String.format("Error parsing [%s]", xmlAsString), e);
25+
}
26+
}
2727

2828
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
package de.martinspielmnann.nmapxmlparser.elements;
22

3-
public record Debugging(String level) {}
3+
public record Debugging(String level) {
4+
}

src/main/java/de/martinspielmnann/nmapxmlparser/elements/ExtraPorts.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
import java.util.List;
44

5-
public record ExtraPorts(String filtered, Long count, List<ExtraReasons> extraReasons) {}
5+
public record ExtraPorts(String filtered, Long count, List<ExtraReasons> extraReasons) {
6+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
package de.martinspielmnann.nmapxmlparser.elements;
22

3-
public record ExtraReasons(String reason, Long count, String proto, String ports) {}
3+
public record ExtraReasons(String reason, Long count, String proto, String ports) {
4+
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package de.martinspielmnann.nmapxmlparser.elements;
22

33
public record Host(String startTime, String endTime, Status status, Address address, HostNames hostNames, Ports ports,
4-
OS os, Uptime uptime, TcpSequence tcpSequence, IpIdSequence ipIdSequence, TcpTsSequence tcpTsSequence,
5-
Times times) {
4+
OS os, Uptime uptime, TcpSequence tcpSequence, IpIdSequence ipIdSequence, TcpTsSequence tcpTsSequence,
5+
Times times) {
66
}
7-

src/main/java/de/martinspielmnann/nmapxmlparser/elements/NmapRun.java

+3-14
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,7 @@
22

33
import java.util.List;
44

5-
public record NmapRun(
6-
String scanner,
7-
String args,
8-
Long start,
9-
String startstr,
10-
String version,
11-
String xmlOutputVersion,
12-
ScanInfo scanInfo,
13-
Verbose verbose,
14-
Debugging debugging,
15-
List<HostHint> hostHints,
16-
List<Host> hosts,
17-
RunStats runStats
18-
) {
5+
public record NmapRun(String scanner, String args, Long start, String startstr, String version, String xmlOutputVersion,
6+
ScanInfo scanInfo, Verbose verbose, Debugging debugging, List<HostHint> hostHints, List<Host> hosts,
7+
RunStats runStats) {
198
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package de.martinspielmnann.nmapxmlparser.elements;
22

33
public record Service(String name, String product, String extraInfo, String tunnel, String method, String conf,
4-
String serviceFP) {
4+
String serviceFP) {
55
}

0 commit comments

Comments
 (0)