Class TimeBasedUploadIdFactory

java.lang.Object
me.desair.tus.server.upload.UploadIdFactory
me.desair.tus.server.upload.TimeBasedUploadIdFactory

public class TimeBasedUploadIdFactory extends UploadIdFactory
Alternative UploadIdFactory implementation that uses the current system time to generate ID's. Since time is not unique, this upload ID factory should not be used in busy, clustered production systems.
  • Constructor Details

    • TimeBasedUploadIdFactory

      public TimeBasedUploadIdFactory()
  • Method Details

    • getIdValueIfValid

      protected Serializable getIdValueIfValid(String extractedUrlId)
      Description copied from class: UploadIdFactory
      Transform the extracted path ID value to a value to use for the upload ID object. If the extracted value is not valid, null is returned
      Specified by:
      getIdValueIfValid in class UploadIdFactory
      Parameters:
      extractedUrlId - The ID extracted from the URL
      Returns:
      Value to use in the UploadId object, null if the extracted URL value was not valid
    • createId

      public UploadId createId()
      Description copied from class: UploadIdFactory
      Create a new unique upload ID.
      Specified by:
      createId in class UploadIdFactory
      Returns:
      A new unique upload ID