diff --git a/build.gradle b/build.gradle index 5e88668..16cb29e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,30 @@ plugins { 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 if (project.hasProperty('customProperties')) { project.logger.info("Loading custom properties from: ${project.property('customProperties')}") @@ -47,8 +71,8 @@ dependencies { group = 'se.koc' version = project.hasProperty('releaseVersion') ? releaseVersion : '1.0.0-SNAPSHOT' -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = 11 +targetCompatibility = 11 compileJava.options.encoding = 'UTF-8' java { @@ -56,14 +80,6 @@ java { withJavadocJar() } -publishing { - publications { - maven(MavenPublication) { - from(components.java) - } - } -} - sourceSets { main { java { @@ -80,3 +96,7 @@ sourceSets { } } } + +tasks.named('sourcesJar') { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE +} diff --git a/build_publish.gradle b/build_publish.gradle index 48eb564..0489e41 100644 --- a/build_publish.gradle +++ b/build_publish.gradle @@ -38,7 +38,7 @@ nexusPublishing { publishing { publications { - mavenJava(MavenPublication) { + maven(MavenPublication) { from components.java pom { @@ -72,7 +72,7 @@ publishing { signing { required { hasProperty("signing.secretKeyRingFile") } - sign publishing.publications.mavenJava + sign publishing.publications.maven } // Generate version.txt @@ -92,17 +92,3 @@ Build-time: ${java.time.LocalDateTime.now()} } 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 -} diff --git a/src/zutil/chart/LineAxis.java b/src/zutil/chart/LineAxis.java index e67b6d6..fd840b2 100755 --- a/src/zutil/chart/LineAxis.java +++ b/src/zutil/chart/LineAxis.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,7 @@ import java.awt.*; import java.awt.geom.Line2D; /** - * + * Class represent a single axis in a graph */ public abstract class LineAxis extends AbstractChart{ diff --git a/src/zutil/converter/Converter.java b/src/zutil/converter/Converter.java index 9e6a6f0..e5b4a98 100755 --- a/src/zutil/converter/Converter.java +++ b/src/zutil/converter/Converter.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -411,18 +411,18 @@ public class Converter { return null; try { if ( c == String.class) return (T) data; - else if (c == Integer.class) return (T) new Integer(data); - else if (c == int.class) return (T) new Integer(data); - else if (c == Long.class) return (T) new Long(data); - else if (c == long.class) return (T) new Long(data); - else if (c == Float.class) return (T) new Float(data); - else if (c == float.class) return (T) new Float(data); - else if (c == Double.class) return (T) new Double(data); - else if (c == double.class) return (T) new Double(data); + else if (c == Integer.class) return (T) Integer.valueOf(data); + else if (c == int.class) return (T) Integer.valueOf(data); + else if (c == Long.class) return (T) Long.valueOf(data); + else if (c == long.class) return (T) Long.valueOf(data); + else if (c == Float.class) return (T) Float.valueOf(data); + else if (c == float.class) return (T) Float.valueOf(data); + else if (c == Double.class) return (T) Double.valueOf(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 == Byte.class) return (T) new Byte(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) Byte.valueOf(data); else if (byte[].class.isAssignableFrom(c)) return (T) Base64Decoder.decode(data); } catch (Exception e) { diff --git a/src/zutil/data/JavaConsole.png b/src/zutil/data/console_icon.png similarity index 100% rename from src/zutil/data/JavaConsole.png rename to src/zutil/data/console_icon.png diff --git a/src/zutil/data/wizard2.jpg b/src/zutil/data/wizard2.jpg deleted file mode 100644 index 1e167bd..0000000 Binary files a/src/zutil/data/wizard2.jpg and /dev/null differ diff --git a/src/zutil/data/wizard3.png b/src/zutil/data/wizard3.png deleted file mode 100644 index 8c0b7f1..0000000 Binary files a/src/zutil/data/wizard3.png and /dev/null differ diff --git a/src/zutil/data/wizard1.jpg b/src/zutil/data/wizard_background.jpg similarity index 100% rename from src/zutil/data/wizard1.jpg rename to src/zutil/data/wizard_background.jpg diff --git a/src/zutil/db/DBQueue.java b/src/zutil/db/DBQueue.java index f1ad14b..d731b1d 100755 --- a/src/zutil/db/DBQueue.java +++ b/src/zutil/db/DBQueue.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -45,8 +45,9 @@ import java.util.Queue; * `data` BINARY NOT NULL * ); * - * @author Ziver * + * @author Ziver + * @param The type of the elements in the queue. */ public class DBQueue implements Queue{ private DBConnection db; diff --git a/src/zutil/db/bean/DBBeanObjectDSO.java b/src/zutil/db/bean/DBBeanObjectDSO.java index 379a2d7..738d8f9 100755 --- a/src/zutil/db/bean/DBBeanObjectDSO.java +++ b/src/zutil/db/bean/DBBeanObjectDSO.java @@ -1,7 +1,7 @@ /* * 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 * 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; /** - * 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 Object that is stored must use Configurator to define what fields that should be stored. - * + *

* This class needs two fields in DB: *

    *
  • String type: defining the class name
  • *
  • Text config: the object configuration is stored as JSON
  • *
+ * + * @param The type of the Object to be stored. */ public abstract class DBBeanObjectDSO extends DBBean { private static final Logger logger = LogUtil.getLogger(); diff --git a/src/zutil/db/handler/ListSQLResult.java b/src/zutil/db/handler/ListSQLResult.java index 20c2b0c..0090f23 100755 --- a/src/zutil/db/handler/ListSQLResult.java +++ b/src/zutil/db/handler/ListSQLResult.java @@ -1,7 +1,7 @@ /* * 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 * 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. * * @author Ziver + * @param The type that the query will return. */ public class ListSQLResult implements SQLResultHandler> { diff --git a/src/zutil/db/handler/SimpleSQLResult.java b/src/zutil/db/handler/SimpleSQLResult.java index 6f6852c..af52ae0 100755 --- a/src/zutil/db/handler/SimpleSQLResult.java +++ b/src/zutil/db/handler/SimpleSQLResult.java @@ -1,7 +1,7 @@ /* * 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 * 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 * * @author Ziver + * @param THe type that the query will return. */ public class SimpleSQLResult implements SQLResultHandler { /** diff --git a/src/zutil/io/MultiPrintStream.java b/src/zutil/io/MultiPrintStream.java index 87da405..20a1199 100755 --- a/src/zutil/io/MultiPrintStream.java +++ b/src/zutil/io/MultiPrintStream.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -34,8 +34,9 @@ import java.lang.reflect.Modifier; import java.util.*; /** + * This class can print strings to multiple PrintStreams + * * @author Ziver - * this class can print strings to multiple PrintStreams */ public class MultiPrintStream extends PrintStream { //the print streams that will print diff --git a/src/zutil/net/FTPClient.java b/src/zutil/net/FTPClient.java index 2c56e8c..ab9f644 100755 --- a/src/zutil/net/FTPClient.java +++ b/src/zutil/net/FTPClient.java @@ -1,7 +1,7 @@ /* * 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 * 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 * - * @deprecated - * @return List with filenames + * @deprecated THe function is incomplete and does not properly parse filenames + * @return List with filenames as Strings */ + @Deprecated public String[] getFileList(String path) throws IOException{ BufferedInputStream data_in = getDataInputStream(); sendCommand("NLST " +path); @@ -185,9 +186,10 @@ public class FTPClient extends Thread{ /** * 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 */ + @Deprecated public String getFileInfo(String path) throws IOException{ Pattern regex = Pattern.compile("\\s+"); diff --git a/src/zutil/net/acme/AcmeChallengeFactory.java b/src/zutil/net/acme/AcmeChallengeFactory.java index da0ebf2..c03e886 100644 --- a/src/zutil/net/acme/AcmeChallengeFactory.java +++ b/src/zutil/net/acme/AcmeChallengeFactory.java @@ -1,15 +1,42 @@ +/* + * 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; import org.shredzone.acme4j.Authorization; import org.shredzone.acme4j.challenge.Challenge; import org.shredzone.acme4j.exception.AcmeException; +/** + * Interface for handling challenge requests flow. + */ public interface AcmeChallengeFactory { /** * Create a new Challenge object and do any needed actions for the challenge to proceed. * - * @param authorization the authorization object t o use for the challenge. + * @param authorization the authorization object to use for the challenge. * @return a Challenge object that will be used to authorize a domain. * @throws AcmeException in case of any issues */ diff --git a/src/zutil/net/dns/packet/DnsConstants.java b/src/zutil/net/dns/packet/DnsConstants.java index 97ad36e..bab358d 100755 --- a/src/zutil/net/dns/packet/DnsConstants.java +++ b/src/zutil/net/dns/packet/DnsConstants.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,7 @@ package zutil.net.dns.packet; /** - * + * A data class containing DNS constants. */ public final class DnsConstants { diff --git a/src/zutil/net/dns/packet/DnsPacketHeader.java b/src/zutil/net/dns/packet/DnsPacketHeader.java index 75901fd..33b9059 100755 --- a/src/zutil/net/dns/packet/DnsPacketHeader.java +++ b/src/zutil/net/dns/packet/DnsPacketHeader.java @@ -1,7 +1,7 @@ /* * 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 * 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; /** + * Class that implements a DNS packet header. + * * @see DNS Spec (rfc1035) * @author Ziver */ diff --git a/src/zutil/net/dns/packet/DnsPacketQuestion.java b/src/zutil/net/dns/packet/DnsPacketQuestion.java index c9eda02..9eacc0f 100755 --- a/src/zutil/net/dns/packet/DnsPacketQuestion.java +++ b/src/zutil/net/dns/packet/DnsPacketQuestion.java @@ -1,7 +1,7 @@ /* * 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 * 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; /** + * A Class implementing the DSN question packet. + * * @see DNS Spec (rfc1035) * @author Ziver */ diff --git a/src/zutil/net/dns/packet/DnsPacketResource.java b/src/zutil/net/dns/packet/DnsPacketResource.java index 756e454..87ffcf8 100755 --- a/src/zutil/net/dns/packet/DnsPacketResource.java +++ b/src/zutil/net/dns/packet/DnsPacketResource.java @@ -1,7 +1,7 @@ /* * 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 * 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 DNS Spec (rfc1035) * @author Ziver */ diff --git a/src/zutil/net/http/HttpServer.java b/src/zutil/net/http/HttpServer.java index 53ec68e..09285d5 100755 --- a/src/zutil/net/http/HttpServer.java +++ b/src/zutil/net/http/HttpServer.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -258,12 +258,12 @@ public class HttpServer extends ThreadedTCPNetworkServer{ } else { synchronized (sessions) { 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()); - sessions.put("" + nextSessionId, session); - out.setCookie(SESSION_KEY_ID, "" + nextSessionId); - ++nextSessionId; + sessions.put(newSessionId, session); + out.setCookie(SESSION_KEY_ID, newSessionId); } } @@ -319,6 +319,9 @@ public class HttpServer extends ThreadedTCPNetworkServer{ } } + private String generateSessionId() { + return "" + nextSessionId++; + } protected static void logRequest(HttpHeader header, Map session, diff --git a/src/zutil/net/mqtt/packet/MqttPacketHeader.java b/src/zutil/net/mqtt/packet/MqttPacketHeader.java index bc29f5a..70b19a5 100755 --- a/src/zutil/net/mqtt/packet/MqttPacketHeader.java +++ b/src/zutil/net/mqtt/packet/MqttPacketHeader.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,7 @@ import java.io.InputStream; import java.io.OutputStream; /** - * + * The Class implements a MQTT generic header. */ public class MqttPacketHeader implements BinaryStruct { diff --git a/src/zutil/parser/BEncodedParser.java b/src/zutil/parser/BEncodedParser.java index f676992..b682a1a 100755 --- a/src/zutil/parser/BEncodedParser.java +++ b/src/zutil/parser/BEncodedParser.java @@ -1,7 +1,7 @@ /* * 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 * 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); tmp = data.substring(index.i, end); 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 * should contain a series of bEncoded elements. For example, the diff --git a/src/zutil/plugin/PluginManager.java b/src/zutil/plugin/PluginManager.java index 05bdc23..e76a9d9 100755 --- a/src/zutil/plugin/PluginManager.java +++ b/src/zutil/plugin/PluginManager.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -52,6 +52,7 @@ import java.util.logging.Logger; * * * @author Ziver + * @param The class of the plugin interface that the plugins fulfills. */ public class PluginManager implements Iterable{ private static Logger log = LogUtil.getLogger(); diff --git a/src/zutil/struct/CircularBuffer.java b/src/zutil/struct/CircularBuffer.java index 98f06f5..b67b0ea 100755 --- a/src/zutil/struct/CircularBuffer.java +++ b/src/zutil/struct/CircularBuffer.java @@ -1,7 +1,7 @@ /* * 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 * 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. - * 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 The type of value that the buffer will hold. */ public class CircularBuffer implements Iterable{ diff --git a/src/zutil/struct/MultiIterator.java b/src/zutil/struct/MultiIterator.java index d6937a8..e07366f 100644 --- a/src/zutil/struct/MultiIterator.java +++ b/src/zutil/struct/MultiIterator.java @@ -1,7 +1,7 @@ /* * 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 * 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 * end of it has been reach and then the next iterator will be used until * all iterators no longer has any items. + * + * @param The type of items that the iterator will iterate over. */ public class MultiIterator implements Iterator { private Queue> queue = new LinkedList<>(); diff --git a/src/zutil/struct/TimedHashSet.java b/src/zutil/struct/TimedHashSet.java index 6d61da6..d6815a5 100755 --- a/src/zutil/struct/TimedHashSet.java +++ b/src/zutil/struct/TimedHashSet.java @@ -1,7 +1,7 @@ /* * 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 * 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. + * + * @param The type of data that shall be stored. */ public class TimedHashSet { diff --git a/src/zutil/ui/Console.java b/src/zutil/ui/Console.java index 64077b9..deb0090 100644 --- a/src/zutil/ui/Console.java +++ b/src/zutil/ui/Console.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,7 @@ import java.io.PrintStream; * */ public class Console{ - public static String DEFAULT_ICON = "zutil/data/JavaConsole.png"; + public static String DEFAULT_ICON = "zutil/data/console_icon.png"; // UI things private JFrame frame; private JTextPane console; diff --git a/src/zutil/ui/conf/Configurator.java b/src/zutil/ui/conf/Configurator.java index 03c105c..9edb10c 100644 --- a/src/zutil/ui/conf/Configurator.java +++ b/src/zutil/ui/conf/Configurator.java @@ -1,7 +1,7 @@ /* * 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 * 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 * these interfaces. * - *

- * Supported field types: String, int, boolean, enum - *

- * Created by Ziver + * @author Ziver + * @param Represents the type of the field that will be configured, Currently supported fields are: String, int, boolean, enum */ public class Configurator { private static final Logger logger = LogUtil.getLogger(); diff --git a/src/zutil/ui/wizard/Wizard.java b/src/zutil/ui/wizard/Wizard.java index 9d5fda1..8306ca2 100644 --- a/src/zutil/ui/wizard/Wizard.java +++ b/src/zutil/ui/wizard/Wizard.java @@ -1,7 +1,7 @@ /* * 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 * 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 static final boolean DEBUG = false; - /** Some defoult backgrounds for the sidebar */ - public static final String BACKGROUND_1 = "zutil/data/wizard1.jpg"; - public static final String BACKGROUND_2 = "zutil/data/wizard2.jpg"; - public static final String BACKGROUND_3 = "zutil/data/wizard3.png"; + /** Some default backgrounds for the sidebar */ + public static final String DEFAULT_BACKGROUND = "zutil/data/wizard_background.jpg"; /** An list with all the previous pages and the current at the beginning */ private HistoryList pages; @@ -62,7 +60,7 @@ public class Wizard implements ActionListener{ /** This is the user listener that handles all the values after the wizard */ 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; @@ -74,7 +72,7 @@ public class Wizard implements ActionListener{ * Creates a new Wizard */ public Wizard(WizardListener listener, WizardPage start) { - this(listener, start, BACKGROUND_1); + this(listener, start, DEFAULT_BACKGROUND); } /** diff --git a/test/zutil/MimeTypeUtilTest.java b/test/zutil/MimeTypeUtilTest.java index d600902..fb804bb 100644 --- a/test/zutil/MimeTypeUtilTest.java +++ b/test/zutil/MimeTypeUtilTest.java @@ -1,7 +1,7 @@ /* * 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 * of this software and associated documentation files (the "Software"), to deal @@ -32,9 +32,9 @@ public class MimeTypeUtilTest { @Test public void getMimeByExtension() { - assertEquals("image/jpeg", MimeTypeUtil.getMimeByExtension("jpg").toString()); - assertEquals("image/png", MimeTypeUtil.getMimeByExtension("png").toString()); - assertEquals("video/mp4", MimeTypeUtil.getMimeByExtension("mp4").toString()); - assertEquals("video/x-matroska", MimeTypeUtil.getMimeByExtension("mkv").toString()); + assertEquals("image/jpeg", "" + MimeTypeUtil.getMimeByExtension("jpg")); + assertEquals("image/png", "" + MimeTypeUtil.getMimeByExtension("png")); + assertEquals("video/mp4", "" + MimeTypeUtil.getMimeByExtension("mp4")); + assertEquals("video/x-matroska", "" + MimeTypeUtil.getMimeByExtension("mkv")); } } \ No newline at end of file