Class ContentIDUtils
- java.lang.Object
 - 
- org.jboss.resteasy.plugins.providers.multipart.ContentIDUtils
 
 
- 
public class ContentIDUtils extends Object
Utility class to help generate, convert RFC compliant Content-ID and cid.- Author:
 - Attila Kiraly
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringCID_URL_SCHEME 
- 
Constructor Summary
Constructors Constructor Description ContentIDUtils() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringconvertCidToContentID(String cid)static StringconvertContentIDToCid(String contentID)static StringgenerateCidFromAddrSpec(String addrSpec)Helper method to generate a standards-compliant cid url from the supplied addrSpec.static StringgenerateContentID()CallsgenerateContentIDFromAddrSpec(String)withgenerateRFC822AddrSpec()as parameter.static StringgenerateContentIDFromAddrSpec(String addrSpec)Helper method to generate a standards-compliant Content-ID header value from the supplied addrSpec.static StringgenerateRFC822AddrSpec()Helper method to generate a standards-compliant, random addr-spec as described in RFC822.static StringparseAddrSpecFromCid(String cid)static StringparseAddrSpecFromContentID(String contentID) 
 - 
 
- 
- 
Field Detail
- 
CID_URL_SCHEME
public static final String CID_URL_SCHEME
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
generateContentID
public static String generateContentID()
CallsgenerateContentIDFromAddrSpec(String)withgenerateRFC822AddrSpec()as parameter.- Returns:
 - the generated Content-ID
 
 
- 
generateContentIDFromAddrSpec
public static String generateContentIDFromAddrSpec(String addrSpec)
Helper method to generate a standards-compliant Content-ID header value from the supplied addrSpec. Used rfc-s: RFC2045, RFC822- Parameters:
 addrSpec- addrSpec- Returns:
 - the generated Content-ID
 
 
- 
generateRFC822AddrSpec
public static String generateRFC822AddrSpec()
Helper method to generate a standards-compliant, random addr-spec as described in RFC822.- Returns:
 - the generated addrSpec
 
 
- 
generateCidFromAddrSpec
public static String generateCidFromAddrSpec(String addrSpec)
Helper method to generate a standards-compliant cid url from the supplied addrSpec. This implementation URL encodes everything without considering if it is needed or not. Used rfc-s: RFC2392, RFC822- Parameters:
 addrSpec- addrSpec- Returns:
 - the generated Content-ID
 
 
- 
parseAddrSpecFromCid
public static String parseAddrSpecFromCid(String cid)
- Parameters:
 cid- the RFC2392 compliant cid- Returns:
 - the RFC822 defined addr-spec decoded from the cid
 
 
- 
parseAddrSpecFromContentID
public static String parseAddrSpecFromContentID(String contentID)
- Parameters:
 contentID- the RFC2045 compliant Content-ID- Returns:
 - the RFC822 defined addr-spec decoded from the contentID
 
 
- 
convertCidToContentID
public static String convertCidToContentID(String cid)
- Parameters:
 cid- the RFC2392 compliant cid- Returns:
 - the RFC2045 compliant Content-ID representing the cid
 
 
 - 
 
 -