Updated to support the split of Utilities + OS project.

This commit is contained in:
Robinson 2022-03-05 22:32:48 +01:00
parent 223b425715
commit 0389306b37
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
11 changed files with 91 additions and 33 deletions

60
LICENSE
View File

@ -510,6 +510,36 @@
Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply
See: https://github.com/JetBrains/kotlin/blob/master/license/README.md
- OS - Information about the system, Java runtime, OS, Window Manager, and Desktop Environment.
[The Apache Software License, Version 2.0]
https://git.dorkbox.com/dorkbox/OS
Copyright 2022
Dorkbox LLC
Extra license information
- Kotlin -
[The Apache Software License, Version 2.0]
https://github.com/JetBrains/kotlin
Copyright 2020
JetBrains s.r.o. and Kotlin Programming Language contributors
Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply
See: https://github.com/JetBrains/kotlin/blob/master/license/README.md
- Updates - Software Update Management
[The Apache Software License, Version 2.0]
https://git.dorkbox.com/dorkbox/Updates
Copyright 2021
Dorkbox LLC
Extra license information
- Kotlin -
[The Apache Software License, Version 2.0]
https://github.com/JetBrains/kotlin
Copyright 2020
JetBrains s.r.o. and Kotlin Programming Language contributors
Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply
See: https://github.com/JetBrains/kotlin/blob/master/license/README.md
- Updates - Software Update Management
[The Apache Software License, Version 2.0]
https://git.dorkbox.com/dorkbox/Updates
@ -524,3 +554,33 @@
JetBrains s.r.o. and Kotlin Programming Language contributors
Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply
See: https://github.com/JetBrains/kotlin/blob/master/license/README.md
- OS - Information about the system, Java runtime, OS, Window Manager, and Desktop Environment.
[The Apache Software License, Version 2.0]
https://git.dorkbox.com/dorkbox/OS
Copyright 2022
Dorkbox LLC
Extra license information
- Kotlin -
[The Apache Software License, Version 2.0]
https://github.com/JetBrains/kotlin
Copyright 2020
JetBrains s.r.o. and Kotlin Programming Language contributors
Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply
See: https://github.com/JetBrains/kotlin/blob/master/license/README.md
- Updates - Software Update Management
[The Apache Software License, Version 2.0]
https://git.dorkbox.com/dorkbox/Updates
Copyright 2021
Dorkbox LLC
Extra license information
- Kotlin -
[The Apache Software License, Version 2.0]
https://github.com/JetBrains/kotlin
Copyright 2020
JetBrains s.r.o. and Kotlin Programming Language contributors
Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply
See: https://github.com/JetBrains/kotlin/blob/master/license/README.md

View File

@ -89,8 +89,9 @@ tasks.jar.get().apply {
dependencies {
api("com.dorkbox:NetworkUtils:2.9.1")
api("com.dorkbox:Utilities:1.16")
api("com.dorkbox:Utilities:1.17")
api("com.dorkbox:Updates:1.1")
api("com.dorkbox:OS:1.0")
val nettyVer = "4.1.74.Final"
api("io.netty:netty-buffer:$nettyVer")

View File

@ -19,14 +19,14 @@ package dorkbox.dns.dns.records;
import java.io.IOException;
import java.util.Base64;
import dorkbox.dns.dns.Mnemonic;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.dns.dns.Compression;
import dorkbox.dns.dns.DnsInput;
import dorkbox.dns.dns.DnsOutput;
import dorkbox.dns.dns.Mnemonic;
import dorkbox.dns.dns.Name;
import dorkbox.dns.dns.constants.DnsRecordType;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.os.OS;
/**
@ -191,7 +191,7 @@ class CERTRecord extends DnsRecord {
if (cert != null) {
if (Options.check("multiline")) {
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
sb.append(Base64.getMimeEncoder().encodeToString(cert));
}
else {

View File

@ -880,7 +880,7 @@ class DnsMessage extends AbstractReferenceCounted implements Cloneable, Referenc
@Override
public
String toString() {
String NL = OS.LINE_SEPARATOR;
String NL = OS.INSTANCE.getLINE_SEPARATOR();
StringBuilder sb = new StringBuilder(NL);
OPTRecord opt = getOPT();
@ -998,7 +998,7 @@ class DnsMessage extends AbstractReferenceCounted implements Cloneable, Referenc
sb.append(rec);
}
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
}
return sb.toString();
}

View File

@ -309,7 +309,7 @@ class Header implements Cloneable {
sb.append("opcode: " + DnsOpCode.string(getOpcode()));
sb.append(", status: " + DnsResponseCode.string(newrcode));
sb.append(", id: " + getID());
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
sb.append(";; flags: ")
.append(printFlags());

View File

@ -20,11 +20,11 @@ import java.io.IOException;
import java.security.PublicKey;
import java.util.Base64;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.Compression;
import dorkbox.dns.dns.DnsInput;
import dorkbox.dns.dns.DnsOutput;
import dorkbox.dns.dns.Name;
import dorkbox.dns.dns.utils.Options;
import dorkbox.os.OS;
/**
@ -89,9 +89,9 @@ class KEYBase extends DnsRecord {
if (key != null) {
if (Options.check("multiline")) {
sb.append(" (");
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
sb.append(Base64.getMimeEncoder().encodeToString(key));
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
sb.append(") ; key_tag = ");
sb.append(getFootprint());
}

View File

@ -19,13 +19,13 @@ package dorkbox.dns.dns.records;
import java.io.IOException;
import java.util.Base64;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.dns.dns.Compression;
import dorkbox.dns.dns.DnsInput;
import dorkbox.dns.dns.DnsOutput;
import dorkbox.dns.dns.Name;
import dorkbox.dns.dns.constants.DnsRecordType;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.os.OS;
/**
@ -66,7 +66,7 @@ class OPENPGPKEYRecord extends DnsRecord {
void rrToString(StringBuilder sb) {
if (cert != null) {
if (Options.check("multiline")) {
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
sb.append(Base64.getEncoder().encodeToString(cert));
}
else {

View File

@ -20,14 +20,14 @@ import java.io.IOException;
import java.util.Base64;
import java.util.Date;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.dns.dns.Compression;
import dorkbox.dns.dns.DnsInput;
import dorkbox.dns.dns.DnsOutput;
import dorkbox.dns.dns.Name;
import dorkbox.dns.dns.constants.DnsRecordType;
import dorkbox.dns.dns.utils.FormattedTime;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.os.OS;
/**
@ -123,7 +123,7 @@ class SIGBase extends DnsRecord {
sb.append(" ");
if (Options.check("multiline")) {
sb.append("(");
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
sb.append("\t");
}
sb.append(FormattedTime.format(expire));
@ -134,7 +134,7 @@ class SIGBase extends DnsRecord {
sb.append(" ");
sb.append(signer);
if (Options.check("multiline")) {
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
sb.append(Base64.getEncoder().encodeToString(signature));
}
else {

View File

@ -20,8 +20,6 @@ import java.io.IOException;
import java.util.Base64;
import java.util.Date;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.dns.dns.Compression;
import dorkbox.dns.dns.DnsInput;
import dorkbox.dns.dns.DnsOutput;
@ -29,6 +27,8 @@ import dorkbox.dns.dns.Name;
import dorkbox.dns.dns.constants.DnsRecordType;
import dorkbox.dns.dns.constants.DnsResponseCode;
import dorkbox.dns.dns.utils.FormattedTime;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.os.OS;
/**
@ -144,7 +144,7 @@ class TKEYRecord extends DnsRecord {
sb.append(" ");
if (Options.check("multiline")) {
sb.append("(")
.append(OS.LINE_SEPARATOR)
.append(OS.INSTANCE.getLINE_SEPARATOR())
.append("\t");
}
sb.append(FormattedTime.format(timeInception));
@ -155,10 +155,10 @@ class TKEYRecord extends DnsRecord {
sb.append(" ");
sb.append(DnsResponseCode.TSIGstring(error));
if (Options.check("multiline")) {
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
if (key != null) {
sb.append(Base64.getMimeEncoder().encodeToString(key));
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
}
if (other != null) {
sb.append(Base64.getMimeEncoder().encodeToString(other));

View File

@ -24,10 +24,10 @@ import dorkbox.dns.dns.Compression;
import dorkbox.dns.dns.DnsInput;
import dorkbox.dns.dns.DnsOutput;
import dorkbox.dns.dns.Name;
import dorkbox.dns.dns.constants.DnsRecordType;
import dorkbox.dns.dns.constants.DnsResponseCode;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.dns.dns.constants.DnsRecordType;
import dorkbox.os.OS;
/**
@ -119,7 +119,7 @@ class TSIGRecord extends DnsRecord {
sb.append(" ");
if (Options.check("multiline")) {
sb.append("(")
.append(OS.LINE_SEPARATOR)
.append(OS.INSTANCE.getLINE_SEPARATOR())
.append("\t");
}
@ -129,7 +129,7 @@ class TSIGRecord extends DnsRecord {
sb.append(" ");
sb.append(signature.length);
if (Options.check("multiline")) {
sb.append(OS.LINE_SEPARATOR);
sb.append(OS.INSTANCE.getLINE_SEPARATOR());
sb.append(Base64.getMimeEncoder().encodeToString(signature));
}
else {
@ -145,9 +145,9 @@ class TSIGRecord extends DnsRecord {
else {
sb.append(other.length);
if (Options.check("multiline")) {
sb.append(OS.LINE_SEPARATOR)
.append(OS.LINE_SEPARATOR)
.append(OS.LINE_SEPARATOR)
sb.append(OS.INSTANCE.getLINE_SEPARATOR())
.append(OS.INSTANCE.getLINE_SEPARATOR())
.append(OS.INSTANCE.getLINE_SEPARATOR())
.append("\t");
}
else {

View File

@ -25,9 +25,6 @@ import dorkbox.dns.dns.Name;
import dorkbox.dns.dns.constants.DnsClass;
import dorkbox.dns.dns.constants.DnsRecordType;
import dorkbox.dns.dns.exceptions.TextParseException;
import dorkbox.dns.dns.records.DNSSEC;
import dorkbox.dns.dns.records.DnsRecord;
import dorkbox.dns.dns.records.KEYBase;
import dorkbox.dns.dns.utils.Options;
import dorkbox.dns.dns.utils.Tokenizer;
import dorkbox.os.OS;
@ -133,7 +130,7 @@ class KEYBaseTest extends TestCase {
tc.rrToString(sb);
out = sb.toString();
assertEquals("255 15 14 (" + OS.LINE_SEPARATOR + Base64.getMimeEncoder().encodeToString(key) + OS.LINE_SEPARATOR + ") ; key_tag = 18509", out);
assertEquals("255 15 14 (" + OS.INSTANCE.getLINE_SEPARATOR() + Base64.getMimeEncoder().encodeToString(key) + OS.INSTANCE.getLINE_SEPARATOR() + ") ; key_tag = 18509", out);
Options.unset("multiline");
}