Class CV2_BagConversion

java.lang.Object
valorless.havenbags.configconversion.CV2_BagConversion

public class CV2_BagConversion extends Object
Performs migration of legacy HavenBags player bag directories to the current format. When a configuration with an outdated config-version is detected, this converter will:
  • Update config-version to 2 and persist the change.
  • Scan the plugin's /bags data directory.
  • Rename each player-named directory to the player's UUID using UUIDFetcher.getUUID(String). The ownerless directory is skipped.
  • Log progress, warnings, and errors during the conversion.
Notes and caveats:
  • This operation performs filesystem I/O and may be slow on large data sets.
  • Directory renames may fail on some platforms; failures are logged and may require manual intervention.
  • Invocation is intended for internal startup-time checks only.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    check(valorless.valorlessutils.config.Config config)
    Checks the provided configuration for an outdated config-version and, if necessary, migrates bag directories from player-name based folders to UUID-based folders.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CV2_BagConversion

      public CV2_BagConversion()
  • Method Details

    • check

      @DoNotCall("Internal Use Only") public static void check(@NotNull valorless.valorlessutils.config.Config config)
      Checks the provided configuration for an outdated config-version and, if necessary, migrates bag directories from player-name based folders to UUID-based folders. The configuration's version is upgraded to 2 and saved before directory migrations begin. Side effects:
      • Updates and saves the supplied configuration.
      • Renames directories under <dataFolder>/bags where applicable.
      • Emits log messages for progress, warnings, and errors.
      Thread-safety: not thread-safe. Intended to be called during plugin initialization before concurrent access to the data folder occurs.
      Parameters:
      config - the plugin configuration holding the config-version key; must be non-null and writable