diff --git a/examples/src/bld/java/com/example/PropertyFileExampleBuild.java b/examples/src/bld/java/com/example/PropertyFileExampleBuild.java index 4924b46..47b0df3 100644 --- a/examples/src/bld/java/com/example/PropertyFileExampleBuild.java +++ b/examples/src/bld/java/com/example/PropertyFileExampleBuild.java @@ -23,6 +23,7 @@ public class PropertyFileExampleBuild extends Project { version = version(0, 1, 0); downloadSources = true; + autoDownloadPurge = true; repositories = List.of(MAVEN_CENTRAL); scope(test) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 9, 2))) diff --git a/src/bld/java/rife/bld/extension/propertyfile/PropertyFileBuild.java b/src/bld/java/rife/bld/extension/propertyfile/PropertyFileBuild.java index 5b25789..394aae0 100644 --- a/src/bld/java/rife/bld/extension/propertyfile/PropertyFileBuild.java +++ b/src/bld/java/rife/bld/extension/propertyfile/PropertyFileBuild.java @@ -21,8 +21,8 @@ public class PropertyFileBuild extends Project { javadocOptions .docLint(NO_MISSING) .link("https://rife2.github.io/rife2/"); -// publishRepository = version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2"); - publishRepository = MAVEN_LOCAL; + publishRepository = version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2"); +// publishRepository = MAVEN_LOCAL; publishInfo = new PublishInfo() .groupId("com.uwyn.rife2") .artifactId("bld-property-file") diff --git a/src/main/java/rife/bld/extension/propertyfile/Entry.java b/src/main/java/rife/bld/extension/propertyfile/Entry.java index 4292ff1..db35c28 100644 --- a/src/main/java/rife/bld/extension/propertyfile/Entry.java +++ b/src/main/java/rife/bld/extension/propertyfile/Entry.java @@ -19,7 +19,7 @@ package rife.bld.extension.propertyfile; import java.util.function.BiFunction; /** - * Declares the modifications to be made to a {@link java.util.Properties Properties} file. + * Declares the modifications to be made to a {@link java.util.Properties string-based property}. * * @author Erik C. Thauvin * @author Geert Bevin @@ -31,7 +31,7 @@ public class Entry extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value. + * Sets the new {@link java.util.Properties property} value. * * @param s The new value */ diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryBase.java b/src/main/java/rife/bld/extension/propertyfile/EntryBase.java index c3f026d..ba9edc7 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryBase.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryBase.java @@ -20,7 +20,7 @@ import java.util.function.BiFunction; import java.util.function.IntFunction; /** - * Declares the modifications to be made to a {@link java.util.Properties Properties} file. + * Declares the modifications to be made to a {@link java.util.Properties property}. * * @author Erik C. Thauvin * @author Geert Bevin @@ -70,14 +70,14 @@ public class EntryBase { } /** - * Set the modify function. + * Sets the modify function. */ protected void setModify(BiFunction modify) { this.modify = modify; } /** - * Set the modify function. + * Sets the modify function. * * @param value the value to perform a modification with */ @@ -87,14 +87,14 @@ public class EntryBase { } /** - * Returns {@code true} if the {@link EntryBase} is to be deleted. + * Returns {@code true} if the {@link java.util.Properties property} is to be deleted. */ protected boolean isDelete() { return isDelete; } /** - * Sets whether the {@link EntryBase} should be deleted. + * Sets whether the {@link java.util.Properties property} should be deleted. */ protected void setDelete(boolean delete) { isDelete = delete; @@ -138,7 +138,7 @@ public class EntryBase { } /** - *

Sets the initial value to set the {@link java.util.Properties property} to, if not already defined.

+ * Sets the initial value to set the {@link java.util.Properties property} to, if not already defined. * * @param defaultValue the default value */ @@ -164,14 +164,14 @@ public class EntryBase { } /** - * Return the {@link EntryDate.Units unit}. + * Returns the {@link EntryDate.Units unit}. */ protected EntryDate.Units getUnit() { return unit; } /** - * Sets the {@link EntryDate.Units unit} value to apply to calculations for {@link EntryDate}. + * Sets the {@link EntryDate.Units unit} value to apply to calculations. * * @param unit the {@link EntryDate.Units unit} */ @@ -198,7 +198,7 @@ public class EntryBase { } /** - * Set a new value for {@link java.util.Properties property}. + * Sets a new value for {@link java.util.Properties property}. * * @param newValue the new value */ diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryDate.java b/src/main/java/rife/bld/extension/propertyfile/EntryDate.java index ffdf99a..89cf028 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryDate.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryDate.java @@ -22,7 +22,7 @@ import java.util.Date; import java.util.function.IntFunction; /** - * Declares the modifications to be made to a {@link java.util.Properties Properties} file. + * Declares the modifications to be made to a {@link java.util.Properties date-based property}. * * @author Erik C. Thauvin * @since 1.0 @@ -38,9 +38,9 @@ public class EntryDate extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value to an {@link Instant} + * Sets the new {@link java.util.Properties property} value to an {@link Instant} * - * @param instant the {@link Instant} to set the value to. + * @param instant the {@link Instant} to set the value to */ public EntryDate set(Instant instant) { setNewValue(instant); @@ -48,9 +48,9 @@ public class EntryDate extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value to an {@link LocalDate} + * Sets the new {@link java.util.Properties property} value to an {@link LocalDate} * - * @param date the {@link LocalDate} to set the value to. + * @param date the {@link LocalDate} to set the value to */ public EntryDate set(LocalDate date) { setNewValue(date); @@ -58,9 +58,9 @@ public class EntryDate extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value to an {@link LocalDateTime} + * Sets the new {@link java.util.Properties property} value to a {@link LocalDateTime} * - * @param date the {@link LocalDateTime} to set the value to. + * @param date the {@link LocalDateTime} to set the value to */ public EntryDate set(LocalDateTime date) { setNewValue(date); @@ -68,9 +68,9 @@ public class EntryDate extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value to an {@link ZonedDateTime} + * Sets the new {@link java.util.Properties property} value to a {@link ZonedDateTime} * - * @param date the {@link ZonedDateTime} to set the value to. + * @param date the {@link ZonedDateTime} to set the value to */ public EntryDate set(ZonedDateTime date) { setNewValue(date); @@ -78,9 +78,9 @@ public class EntryDate extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value to an {@link LocalTime} + * Sets the new {@link java.util.Properties property} value to a {@link LocalTime} * - * @param time the {@link LocalTime} to set the value to. + * @param time the {@link LocalTime} to set the value to */ public EntryDate set(LocalTime time) { setNewValue(time); @@ -88,9 +88,9 @@ public class EntryDate extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value to an {@link Calendar} + * Sets the new {@link java.util.Properties property} value to a {@link Calendar} * - * @param cal the {@link Calendar} to set the value to. + * @param cal the {@link Calendar} to set the value to */ public EntryDate set(Calendar cal) { setNewValue(cal); @@ -98,9 +98,9 @@ public class EntryDate extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value to an {@link Date} + * Sets the new {@link java.util.Properties property} value to a {@link Date} * - * @param date the {@link Date} to set the value to. + * @param date the {@link Date} to set the value to */ public EntryDate set(Date date) { setNewValue(date); @@ -108,7 +108,7 @@ public class EntryDate extends EntryBase { } /** - * Sets the new value to now. + * Sets the new {@link java.util.Properties property} value to now. */ public EntryDate now() { setNewValue("now"); @@ -118,7 +118,7 @@ public class EntryDate extends EntryBase { /** * Creates a new {@link EntryDate entry}. * - * @param calc the calculation function. + * @param calc the calculation function */ public EntryDate calc(IntFunction calc) { setCalc(calc); @@ -126,9 +126,8 @@ public class EntryDate extends EntryBase { } /** - *

Sets the pattern for {@link EntryInt} and {@link EntryDate} to - * {@link java.text.DecimalFormat DecimalFormat} and {@link java.time.format.DateTimeFormatter DateTimeFormatter} - * respectively.

+ * Sets the pattern for {@link EntryInt} and {@link EntryDate} to{@link java.text.DecimalFormat DecimalFormat} and + * {@link java.time.format.DateTimeFormatter DateTimeFormatter} respectively. * * @param pattern the pattern */ diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryInt.java b/src/main/java/rife/bld/extension/propertyfile/EntryInt.java index 86960ad..052010a 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryInt.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryInt.java @@ -19,7 +19,7 @@ package rife.bld.extension.propertyfile; import java.util.function.IntFunction; /** - * Declares the modifications to be made to a {@link java.util.Properties Properties} file. + * Declares the modifications to be made to a {@link java.util.Properties integer-based property}. * * @author Erik C. Thauvin * @since 1.0 @@ -35,9 +35,9 @@ public class EntryInt extends EntryBase { } /** - * Set the new {@link java.util.Properties property} value to an integer. + * Sets the new {@link java.util.Properties property} value to an integer. * - * @param i The integer to set the value to. + * @param i The integer to set the value to */ public EntryInt set(int i) { setNewValue(i); @@ -45,7 +45,7 @@ public class EntryInt extends EntryBase { } /** - *

Sets the initial value to set the {@link java.util.Properties property} to, if not already defined.

+ * Sets the initial value to set the {@link java.util.Properties property} to, if not already defined. * * @param defaultValue the default value */ diff --git a/src/main/java/rife/bld/extension/propertyfile/PropertyFileOperation.java b/src/main/java/rife/bld/extension/propertyfile/PropertyFileOperation.java index a320fbe..77cc22b 100644 --- a/src/main/java/rife/bld/extension/propertyfile/PropertyFileOperation.java +++ b/src/main/java/rife/bld/extension/propertyfile/PropertyFileOperation.java @@ -76,9 +76,9 @@ public class PropertyFileOperation extends AbstractOperationErik C. Thauvin * @since 1.0 @@ -52,7 +51,6 @@ public final class PropertyFileUtils { * @param command the issuing command * @param p the {@link Properties property} * @param entry the {@link Entry} containing the {@link Properties property} edits - * @return {@code true} if successful */ public static boolean processDate(String command, Properties p, EntryDate entry, boolean failOnWarning) throws Exception { @@ -154,7 +152,6 @@ public final class PropertyFileUtils { * @param value the value * @param newValue the new value * @param defaultValue the default value - * @return the current value */ public static Object currentValue(String value, Object defaultValue, Object newValue) { if (newValue != null) { @@ -172,7 +169,6 @@ public final class PropertyFileUtils { * @param command the issuing command * @param p the {@link Properties property} * @param entry the {@link Entry} containing the {@link Properties property} edits - * @return {@code true} if successful */ public static boolean processInt(String command, Properties p, EntryInt entry, boolean failOnWarning) throws Exception { @@ -205,7 +201,6 @@ public final class PropertyFileUtils { * * @param p the {@link Properties property} * @param entry the {@link Entry} containing the {@link Properties property} edits - * @return {@code true} if successful */ public static boolean processString(Properties p, Entry entry) { var value = PropertyFileUtils.currentValue(p.getProperty(entry.getKey()), entry.getDefaultValue(), @@ -238,7 +233,7 @@ public final class PropertyFileUtils { * @param command The command name * @param message the message log * @param e the related exception - * @param failOnWarning skips logging the exception if set to {@code false} + * @param failOnWarning logs and throws exception if set to {@code true} */ static void warn(String command, String message, Exception e, boolean failOnWarning) throws Exception { if (failOnWarning) { @@ -253,9 +248,8 @@ public final class PropertyFileUtils { * Loads a {@link Properties properties} file. * * @param command the issuing command - * @param file the file location. + * @param file the file location * @param p the {@link Properties properties} to load into. - * @return {@code true} if successful */ public static boolean loadProperties(String command, File file, Properties p) throws Exception { boolean success = true;