Class Metadata

java.lang.Object
com.avrix.plugin.Metadata

public final class Metadata extends Object
Represents metadata for a plugin, including various details such as name, description, author, version, and dependencies.
  • Method Details

    • createFromJar

      public static Metadata createFromJar(File jarFile, String metadataFileName)
      Creating metadata from a file inside a Jar archive
      Parameters:
      jarFile - Jar archive in the form File
      metadataFileName - full path to the YAML file with metadata in the form String
      Returns:
      if creation is successful - Metadata object, if an error occurs - null
    • sortMetadata

      public static List<Metadata> sortMetadata(List<Metadata> metadataList)
      Sorts a list of Metadata objects based on their dependencies using topological sort.
      Parameters:
      metadataList - the list of Metadata objects to be sorted
      Returns:
      a sorted list of Metadata objects where dependencies appear before the dependent objects
      Throws:
      IllegalStateException - if a cyclic dependency is detected
      IllegalArgumentException - if a dependency is missing from the metadata list
    • getConfigFolder

      public File getConfigFolder()
      Returns a File object representing the configuration directory for this plugin. The directory path is normalized to prevent problems with various file systems.
      Returns:
      A File object pointing to the normalized path to the plugin configuration directory.
    • getName

      public String getName()
      Returns the name of the plugin.
      Returns:
      the name of the plugin
    • getEnvironment

      public Environment getEnvironment()
      Returns the Environment of the plugin.
      Returns:
      the Environment of the plugin
    • getPluginFile

      public File getPluginFile()
      Returns the plugin File
      Returns:
      the File of the plugin
    • getId

      public String getId()
      Returns the ID of the plugin.
      Returns:
      the ID of the plugin
    • getDescription

      public String getDescription()
      Returns the description of the plugin.
      Returns:
      the description of the plugin
    • getAuthor

      public String getAuthor()
      Returns the author of the plugin.
      Returns:
      the author of the plugin
    • getVersion

      public String getVersion()
      Returns the version of the plugin.
      Returns:
      the version of the plugin
    • getLicense

      public String getLicense()
      Returns the license of the plugin.
      Returns:
      the license of the plugin
    • getContacts

      public String getContacts()
      Returns the contact information for the plugin author.
      Returns:
      the contact information for the plugin author
    • getEntryPoints

      public List<String> getEntryPoints()
      Returns the List of entry points for the plugin.
      Returns:
      the List of entry points for the plugin
    • getPatchList

      public List<String> getPatchList()
      Returns the List of patches for the plugin.
      Returns:
      the List of patches for the plugin
    • getDependencies

      public Map<String,String> getDependencies()
      Returns the Map of dependencies for the plugin.
      Returns:
      the Map of dependencies for the plugin