Class Persistence

java.lang.Object
com.cloudbees.jenkins.support.util.Persistence

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class Persistence extends Object
Utility methods for persisting non-Describable classes.
Since:
TODO
See Also:
  • Method Details

    • getConfigFile

      @NonNull public static <T extends Saveable> XmlFile getConfigFile(@NonNull Class<T> clazz)
      Returns:
      the default config file for the given class
    • save

      public static <T extends Saveable> void save(@NonNull T object) throws IOException
      Saves a Saveable object to its default location. This collaborates with BulkChange.
      Throws:
      IOException
    • load

      @CheckForNull public static <T extends Saveable> T load(@NonNull Class<T> clazz) throws IOException
      Loads a Saveable object from its default location or returns null when the file doesn't exist.
      Throws:
      IOException