Java UUID Create generateContentID()

Here you can find the source of generateContentID()

Description

Calls #generateContentIDFromAddrSpec(String) with #generateRFC822AddrSpec() as parameter.

License

Open Source License

Return

the generated Content-ID

Declaration

public static String generateContentID() 

Method Source Code

//package com.java2s;

import java.util.UUID;

public class Main {
    /**//from  w  w w.j  av  a  2  s. c om
     * Calls {@link #generateContentIDFromAddrSpec(String)} with
     * {@link #generateRFC822AddrSpec()} as parameter.
     * 
     * @return the generated Content-ID
     */
    public static String generateContentID() {
        return generateContentIDFromAddrSpec(generateRFC822AddrSpec());
    }

    /**
     * Helper method to generate a standards-compliant Content-ID header value
     * from the supplied addrSpec.
     * 
     * Used rfc-s: RFC2045, RFC822
     * 
     * @return the generated Content-ID
     */
    public static String generateContentIDFromAddrSpec(String addrSpec) {
        return "<" + addrSpec + ">";
    }

    /**
     * Helper method to generate a standards-compliant, random addr-spec as
     * described in RFC822.
     * 
     * @return the generated addrSpec
     */
    public static String generateRFC822AddrSpec() {
        return UUID.randomUUID().toString() + "@resteasy-multipart";
    }
}

Related

  1. generateAttributeId()
  2. generateBoundary(final String value)
  3. generateClientId()
  4. generateConnectionId()
  5. generateConsumerName(String serverInstanceId)
  6. generateCurrentTimestampUUID()
  7. generateEmailPrefix()
  8. generateFakedDeviceTokenString()
  9. generateFileName(String path)