Interface NameGenerator

  • All Known Implementing Classes:
    DefaultNameGenerator, TempFileNameGenerator

    public interface NameGenerator
    A name generator is a general service to generate unique names within an content location.
    Author:
    Thomas Morgner
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String generateName​(java.lang.String nameHint, java.lang.String mimeType)
      Generates a new name for the location.
    • Method Detail

      • generateName

        java.lang.String generateName​(java.lang.String nameHint,
                                      java.lang.String mimeType)
                               throws ContentIOException
        Generates a new name for the location. The name-generator may use both the name-hint and mimetype to compute the new name.
        Parameters:
        nameHint - the name hint, usually a identifier for the new filename (can be null).
        mimeType - the mime type of the new filename. Usually used to compute a suitable file-suffix.
        Returns:
        the generated name, never null.
        Throws:
        ContentIOException - if the name could not be generated for any reason.