Fixed issues with gradle uplift and added some additional javadoc
This commit is contained in:
parent
aad0ea81c7
commit
5f02f65ead
30 changed files with 144 additions and 92 deletions
40
build.gradle
40
build.gradle
|
|
@ -7,6 +7,30 @@ plugins {
|
||||||
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
|
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2025 Ziver Koc
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
// Load custom properties
|
// Load custom properties
|
||||||
if (project.hasProperty('customProperties')) {
|
if (project.hasProperty('customProperties')) {
|
||||||
project.logger.info("Loading custom properties from: ${project.property('customProperties')}")
|
project.logger.info("Loading custom properties from: ${project.property('customProperties')}")
|
||||||
|
|
@ -47,8 +71,8 @@ dependencies {
|
||||||
|
|
||||||
group = 'se.koc'
|
group = 'se.koc'
|
||||||
version = project.hasProperty('releaseVersion') ? releaseVersion : '1.0.0-SNAPSHOT'
|
version = project.hasProperty('releaseVersion') ? releaseVersion : '1.0.0-SNAPSHOT'
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 11
|
||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
|
@ -56,14 +80,6 @@ java {
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
maven(MavenPublication) {
|
|
||||||
from(components.java)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
|
|
@ -80,3 +96,7 @@ sourceSets {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.named('sourcesJar') {
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ nexusPublishing {
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
maven(MavenPublication) {
|
||||||
from components.java
|
from components.java
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
|
|
@ -72,7 +72,7 @@ publishing {
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
required { hasProperty("signing.secretKeyRingFile") }
|
required { hasProperty("signing.secretKeyRingFile") }
|
||||||
sign publishing.publications.mavenJava
|
sign publishing.publications.maven
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate version.txt
|
// Generate version.txt
|
||||||
|
|
@ -92,17 +92,3 @@ Build-time: ${java.time.LocalDateTime.now()}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt
|
sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt
|
||||||
|
|
||||||
// Generate additional Jars
|
|
||||||
|
|
||||||
task javadocJar(type: Jar) {
|
|
||||||
from javadoc
|
|
||||||
}
|
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
|
||||||
from sourceSets.main.allSource
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
archives javadocJar, sourcesJar
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -28,7 +28,7 @@ import java.awt.*;
|
||||||
import java.awt.geom.Line2D;
|
import java.awt.geom.Line2D;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Class represent a single axis in a graph
|
||||||
*/
|
*/
|
||||||
public abstract class LineAxis extends AbstractChart{
|
public abstract class LineAxis extends AbstractChart{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -411,18 +411,18 @@ public class Converter {
|
||||||
return null;
|
return null;
|
||||||
try {
|
try {
|
||||||
if ( c == String.class) return (T) data;
|
if ( c == String.class) return (T) data;
|
||||||
else if (c == Integer.class) return (T) new Integer(data);
|
else if (c == Integer.class) return (T) Integer.valueOf(data);
|
||||||
else if (c == int.class) return (T) new Integer(data);
|
else if (c == int.class) return (T) Integer.valueOf(data);
|
||||||
else if (c == Long.class) return (T) new Long(data);
|
else if (c == Long.class) return (T) Long.valueOf(data);
|
||||||
else if (c == long.class) return (T) new Long(data);
|
else if (c == long.class) return (T) Long.valueOf(data);
|
||||||
else if (c == Float.class) return (T) new Float(data);
|
else if (c == Float.class) return (T) Float.valueOf(data);
|
||||||
else if (c == float.class) return (T) new Float(data);
|
else if (c == float.class) return (T) Float.valueOf(data);
|
||||||
else if (c == Double.class) return (T) new Double(data);
|
else if (c == Double.class) return (T) Double.valueOf(data);
|
||||||
else if (c == double.class) return (T) new Double(data);
|
else if (c == double.class) return (T) Double.valueOf(data);
|
||||||
else if (c == Boolean.class) return (T) Boolean.valueOf(data);
|
else if (c == Boolean.class) return (T) Boolean.valueOf(data);
|
||||||
else if (c == boolean.class) return (T) Boolean.valueOf(data);
|
else if (c == boolean.class) return (T) Boolean.valueOf(data);
|
||||||
else if (c == Byte.class) return (T) new Byte(data);
|
else if (c == Byte.class) return (T) Byte.valueOf(data);
|
||||||
else if (c == byte.class) return (T) new Byte(data);
|
else if (c == byte.class) return (T) Byte.valueOf(data);
|
||||||
else if (byte[].class.isAssignableFrom(c))
|
else if (byte[].class.isAssignableFrom(c))
|
||||||
return (T) Base64Decoder.decode(data);
|
return (T) Base64Decoder.decode(data);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 185 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 432 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -45,8 +45,9 @@ import java.util.Queue;
|
||||||
* `data` BINARY NOT NULL
|
* `data` BINARY NOT NULL
|
||||||
* );
|
* );
|
||||||
* </PRE>
|
* </PRE>
|
||||||
* @author Ziver
|
|
||||||
*
|
*
|
||||||
|
* @author Ziver
|
||||||
|
* @param <E> The type of the elements in the queue.
|
||||||
*/
|
*/
|
||||||
public class DBQueue<E> implements Queue<E>{
|
public class DBQueue<E> implements Queue<E>{
|
||||||
private DBConnection db;
|
private DBConnection db;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -35,15 +35,17 @@ import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A intermediate class for loading Objects of generic Classes.
|
* An intermediate class for loading Objects of generic Classes.
|
||||||
* The extending class must set the "superBean" parameter to true in {@link DBBean.DBTable}.
|
* The extending class must set the "superBean" parameter to true in {@link DBBean.DBTable}.
|
||||||
* The Object that is stored must use Configurator to define what fields that should be stored.
|
* The Object that is stored must use Configurator to define what fields that should be stored.
|
||||||
*
|
* <p>
|
||||||
* This class needs two fields in DB:
|
* This class needs two fields in DB:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>String type: defining the class name</li>
|
* <li>String type: defining the class name</li>
|
||||||
* <li>Text config: the object configuration is stored as JSON</li>
|
* <li>Text config: the object configuration is stored as JSON</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param <T> The type of the Object to be stored.
|
||||||
*/
|
*/
|
||||||
public abstract class DBBeanObjectDSO<T> extends DBBean {
|
public abstract class DBBeanObjectDSO<T> extends DBBean {
|
||||||
private static final Logger logger = LogUtil.getLogger();
|
private static final Logger logger = LogUtil.getLogger();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -38,6 +38,7 @@ import java.util.List;
|
||||||
* The handler will add the first column of every row to a list.
|
* The handler will add the first column of every row to a list.
|
||||||
*
|
*
|
||||||
* @author Ziver
|
* @author Ziver
|
||||||
|
* @param <T> The type that the query will return.
|
||||||
*/
|
*/
|
||||||
public class ListSQLResult<T> implements SQLResultHandler<List<T>> {
|
public class ListSQLResult<T> implements SQLResultHandler<List<T>> {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -34,6 +34,7 @@ import java.sql.Statement;
|
||||||
* Returns the first column of the first row from the query
|
* Returns the first column of the first row from the query
|
||||||
*
|
*
|
||||||
* @author Ziver
|
* @author Ziver
|
||||||
|
* @param <T> THe type that the query will return.
|
||||||
*/
|
*/
|
||||||
public class SimpleSQLResult<T> implements SQLResultHandler<T> {
|
public class SimpleSQLResult<T> implements SQLResultHandler<T> {
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -34,8 +34,9 @@ import java.lang.reflect.Modifier;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* This class can print strings to multiple PrintStreams
|
||||||
|
*
|
||||||
* @author Ziver
|
* @author Ziver
|
||||||
* this class can print strings to multiple PrintStreams
|
|
||||||
*/
|
*/
|
||||||
public class MultiPrintStream extends PrintStream {
|
public class MultiPrintStream extends PrintStream {
|
||||||
//the print streams that will print
|
//the print streams that will print
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -168,9 +168,10 @@ public class FTPClient extends Thread{
|
||||||
/**
|
/**
|
||||||
* Returns a LinkedList with names of all the files in the directory
|
* Returns a LinkedList with names of all the files in the directory
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @deprecated THe function is incomplete and does not properly parse filenames
|
||||||
* @return List with filenames
|
* @return List with filenames as Strings
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public String[] getFileList(String path) throws IOException{
|
public String[] getFileList(String path) throws IOException{
|
||||||
BufferedInputStream data_in = getDataInputStream();
|
BufferedInputStream data_in = getDataInputStream();
|
||||||
sendCommand("NLST " +path);
|
sendCommand("NLST " +path);
|
||||||
|
|
@ -185,9 +186,10 @@ public class FTPClient extends Thread{
|
||||||
/**
|
/**
|
||||||
* Returns information about a file or directory
|
* Returns information about a file or directory
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @deprecated THe function is incomplete and does not properly parse filenames
|
||||||
* @return a List of Strings with information
|
* @return a List of Strings with information
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public String getFileInfo(String path) throws IOException{
|
public String getFileInfo(String path) throws IOException{
|
||||||
Pattern regex = Pattern.compile("\\s+");
|
Pattern regex = Pattern.compile("\\s+");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,36 @@
|
||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2025 Ziver Koc
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
package zutil.net.acme;
|
package zutil.net.acme;
|
||||||
|
|
||||||
import org.shredzone.acme4j.Authorization;
|
import org.shredzone.acme4j.Authorization;
|
||||||
import org.shredzone.acme4j.challenge.Challenge;
|
import org.shredzone.acme4j.challenge.Challenge;
|
||||||
import org.shredzone.acme4j.exception.AcmeException;
|
import org.shredzone.acme4j.exception.AcmeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for handling challenge requests flow.
|
||||||
|
*/
|
||||||
public interface AcmeChallengeFactory {
|
public interface AcmeChallengeFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
package zutil.net.dns.packet;
|
package zutil.net.dns.packet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* A data class containing DNS constants.
|
||||||
*/
|
*/
|
||||||
public final class DnsConstants {
|
public final class DnsConstants {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -27,6 +27,8 @@ package zutil.net.dns.packet;
|
||||||
import zutil.parser.binary.BinaryStruct;
|
import zutil.parser.binary.BinaryStruct;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Class that implements a DNS packet header.
|
||||||
|
*
|
||||||
* @see <a href="http://tools.ietf.org/html/rfc1035">DNS Spec (rfc1035)</a>
|
* @see <a href="http://tools.ietf.org/html/rfc1035">DNS Spec (rfc1035)</a>
|
||||||
* @author Ziver
|
* @author Ziver
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -27,6 +27,8 @@ package zutil.net.dns.packet;
|
||||||
import zutil.parser.binary.BinaryStruct;
|
import zutil.parser.binary.BinaryStruct;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* A Class implementing the DSN question packet.
|
||||||
|
*
|
||||||
* @see <a href="http://tools.ietf.org/html/rfc1035">DNS Spec (rfc1035)</a>
|
* @see <a href="http://tools.ietf.org/html/rfc1035">DNS Spec (rfc1035)</a>
|
||||||
* @author Ziver
|
* @author Ziver
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -28,6 +28,8 @@ import zutil.parser.binary.BinaryStruct;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* A Class implementing the DNS resource packet.
|
||||||
|
*
|
||||||
* @see <a href="http://tools.ietf.org/html/rfc1035">DNS Spec (rfc1035)</a>
|
* @see <a href="http://tools.ietf.org/html/rfc1035">DNS Spec (rfc1035)</a>
|
||||||
* @author Ziver
|
* @author Ziver
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -258,12 +258,12 @@ public class HttpServer extends ThreadedTCPNetworkServer{
|
||||||
} else {
|
} else {
|
||||||
synchronized (sessions) {
|
synchronized (sessions) {
|
||||||
session = new ConcurrentHashMap<>();
|
session = new ConcurrentHashMap<>();
|
||||||
session.put(SESSION_KEY_ID, "" + nextSessionId);
|
String newSessionId = generateSessionId();
|
||||||
|
session.put(SESSION_KEY_ID, newSessionId);
|
||||||
session.put(SESSION_KEY_TTL, new Timer(SESSION_TTL).start());
|
session.put(SESSION_KEY_TTL, new Timer(SESSION_TTL).start());
|
||||||
|
|
||||||
sessions.put("" + nextSessionId, session);
|
sessions.put(newSessionId, session);
|
||||||
out.setCookie(SESSION_KEY_ID, "" + nextSessionId);
|
out.setCookie(SESSION_KEY_ID, newSessionId);
|
||||||
++nextSessionId;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,6 +319,9 @@ public class HttpServer extends ThreadedTCPNetworkServer{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String generateSessionId() {
|
||||||
|
return "" + nextSessionId++;
|
||||||
|
}
|
||||||
|
|
||||||
protected static void logRequest(HttpHeader header,
|
protected static void logRequest(HttpHeader header,
|
||||||
Map<String,Object> session,
|
Map<String,Object> session,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -31,7 +31,7 @@ import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class implements a MQTT generic header.
|
||||||
*/
|
*/
|
||||||
public class MqttPacketHeader implements BinaryStruct {
|
public class MqttPacketHeader implements BinaryStruct {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -70,7 +70,7 @@ public class BEncodedParser {
|
||||||
throw new ParseException("Corrupt bEncoding", index.i);
|
throw new ParseException("Corrupt bEncoding", index.i);
|
||||||
tmp = data.substring(index.i, end);
|
tmp = data.substring(index.i, end);
|
||||||
index.i += tmp.length() + 1;
|
index.i += tmp.length() + 1;
|
||||||
return new DataNode(new Long(tmp));
|
return new DataNode(Long.valueOf(tmp));
|
||||||
/*
|
/*
|
||||||
* Lists are prefixed with a l and terminated by an e. The list
|
* Lists are prefixed with a l and terminated by an e. The list
|
||||||
* should contain a series of bEncoded elements. For example, the
|
* should contain a series of bEncoded elements. For example, the
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -52,6 +52,7 @@ import java.util.logging.Logger;
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author Ziver
|
* @author Ziver
|
||||||
|
* @param <T> The class of the plugin interface that the plugins fulfills.
|
||||||
*/
|
*/
|
||||||
public class PluginManager<T> implements Iterable<PluginData>{
|
public class PluginManager<T> implements Iterable<PluginData>{
|
||||||
private static Logger log = LogUtil.getLogger();
|
private static Logger log = LogUtil.getLogger();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -30,9 +30,10 @@ import java.util.NoSuchElementException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is a first in first out circular buffer with a fixed size.
|
* This class is a first in first out circular buffer with a fixed size.
|
||||||
* If the size is exceed then the oldest item will be removed.
|
* If the size is exceeded then the oldest item will be removed.
|
||||||
*
|
*
|
||||||
* Created by Ziver on 2015-09-22.
|
* @author Ziver
|
||||||
|
* @param <T> The type of value that the buffer will hold.
|
||||||
*/
|
*/
|
||||||
public class CircularBuffer<T> implements Iterable<T>{
|
public class CircularBuffer<T> implements Iterable<T>{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -34,6 +34,8 @@ import java.util.Queue;
|
||||||
* This class will start by iterating through the first Iterator until the
|
* This class will start by iterating through the first Iterator until the
|
||||||
* end of it has been reach and then the next iterator will be used until
|
* end of it has been reach and then the next iterator will be used until
|
||||||
* all iterators no longer has any items.
|
* all iterators no longer has any items.
|
||||||
|
*
|
||||||
|
* @param <T> The type of items that the iterator will iterate over.
|
||||||
*/
|
*/
|
||||||
public class MultiIterator<T> implements Iterator<T> {
|
public class MultiIterator<T> implements Iterator<T> {
|
||||||
private Queue<Iterator<T>> queue = new LinkedList<>();
|
private Queue<Iterator<T>> queue = new LinkedList<>();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -32,6 +32,8 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a timed HashSet. Each entry has a limited time to live.
|
* This is a timed HashSet. Each entry has a limited time to live.
|
||||||
|
*
|
||||||
|
* @param <T> The type of data that shall be stored.
|
||||||
*/
|
*/
|
||||||
public class TimedHashSet<T> {
|
public class TimedHashSet<T> {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -45,7 +45,7 @@ import java.io.PrintStream;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Console{
|
public class Console{
|
||||||
public static String DEFAULT_ICON = "zutil/data/JavaConsole.png";
|
public static String DEFAULT_ICON = "zutil/data/console_icon.png";
|
||||||
// UI things
|
// UI things
|
||||||
private JFrame frame;
|
private JFrame frame;
|
||||||
private JTextPane console;
|
private JTextPane console;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -51,10 +51,8 @@ import java.util.logging.Logger;
|
||||||
* The configured object will automatically be registered as a listener if it also implements
|
* The configured object will automatically be registered as a listener if it also implements
|
||||||
* these interfaces.
|
* these interfaces.
|
||||||
*
|
*
|
||||||
* <p>
|
* @author Ziver
|
||||||
* Supported field types: String, int, boolean, enum
|
* @param <T> Represents the type of the field that will be configured, Currently supported fields are: String, int, boolean, enum
|
||||||
* <p>
|
|
||||||
* Created by Ziver
|
|
||||||
*/
|
*/
|
||||||
public class Configurator<T> {
|
public class Configurator<T> {
|
||||||
private static final Logger logger = LogUtil.getLogger();
|
private static final Logger logger = LogUtil.getLogger();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -48,10 +48,8 @@ import java.util.ResourceBundle;
|
||||||
public class Wizard implements ActionListener{
|
public class Wizard implements ActionListener{
|
||||||
public static final boolean DEBUG = false;
|
public static final boolean DEBUG = false;
|
||||||
|
|
||||||
/** Some defoult backgrounds for the sidebar */
|
/** Some default backgrounds for the sidebar */
|
||||||
public static final String BACKGROUND_1 = "zutil/data/wizard1.jpg";
|
public static final String DEFAULT_BACKGROUND = "zutil/data/wizard_background.jpg";
|
||||||
public static final String BACKGROUND_2 = "zutil/data/wizard2.jpg";
|
|
||||||
public static final String BACKGROUND_3 = "zutil/data/wizard3.png";
|
|
||||||
|
|
||||||
/** An list with all the previous pages and the current at the beginning */
|
/** An list with all the previous pages and the current at the beginning */
|
||||||
private HistoryList<WizardPage> pages;
|
private HistoryList<WizardPage> pages;
|
||||||
|
|
@ -62,7 +60,7 @@ public class Wizard implements ActionListener{
|
||||||
/** This is the user listener that handles all the values after the wizard */
|
/** This is the user listener that handles all the values after the wizard */
|
||||||
private WizardListener listener;
|
private WizardListener listener;
|
||||||
|
|
||||||
/** This is the old validation fail, this is needed for reseting purposes */
|
/** This is the old validation fail, this is needed for resting purposes */
|
||||||
private ValidationFail oldFail;
|
private ValidationFail oldFail;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -74,7 +72,7 @@ public class Wizard implements ActionListener{
|
||||||
* Creates a new Wizard
|
* Creates a new Wizard
|
||||||
*/
|
*/
|
||||||
public Wizard(WizardListener listener, WizardPage start) {
|
public Wizard(WizardListener listener, WizardPage start) {
|
||||||
this(listener, start, BACKGROUND_1);
|
this(listener, start, DEFAULT_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2020 Ziver Koc
|
* Copyright (c) 2020-2025 Ziver Koc
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -32,9 +32,9 @@ public class MimeTypeUtilTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMimeByExtension() {
|
public void getMimeByExtension() {
|
||||||
assertEquals("image/jpeg", MimeTypeUtil.getMimeByExtension("jpg").toString());
|
assertEquals("image/jpeg", "" + MimeTypeUtil.getMimeByExtension("jpg"));
|
||||||
assertEquals("image/png", MimeTypeUtil.getMimeByExtension("png").toString());
|
assertEquals("image/png", "" + MimeTypeUtil.getMimeByExtension("png"));
|
||||||
assertEquals("video/mp4", MimeTypeUtil.getMimeByExtension("mp4").toString());
|
assertEquals("video/mp4", "" + MimeTypeUtil.getMimeByExtension("mp4"));
|
||||||
assertEquals("video/x-matroska", MimeTypeUtil.getMimeByExtension("mkv").toString());
|
assertEquals("video/x-matroska", "" + MimeTypeUtil.getMimeByExtension("mkv"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue