Class NamingPolicy.HashPrefixed

java.lang.Object
com.artipie.rpm.NamingPolicy.HashPrefixed
All Implemented Interfaces:
NamingPolicy
Enclosing interface:
NamingPolicy

public static final class NamingPolicy.HashPrefixed extends Object implements NamingPolicy
Add hash prefix to names.
Since:
0.3
  • Constructor Details

    • HashPrefixed

      public HashPrefixed(Digest dgst)
      Ctor.
      Parameters:
      dgst - One of the supported digest algorithms
  • Method Details

    • name

      public String name(String source, Path content) throws IOException
      Description copied from interface: NamingPolicy
      Name for source with its content, without file extension.
      Specified by:
      name in interface NamingPolicy
      Parameters:
      source - Metadata file name
      content - Metadata file content
      Returns:
      File name
      Throws:
      IOException - On error
    • fullName

      public String fullName(XmlPackage source, String prefix)
      Description copied from interface: NamingPolicy
      Full relative path for the metadata source file, with extension. This path is build as `metadata/[prefix]-[sourse-name].xml.gz`. Can be used as a storage key.
      Specified by:
      fullName in interface NamingPolicy
      Parameters:
      source - Source metadata
      prefix - Source prefix
      Returns:
      File name