info.magnolia.cms.util
Class LinkUtil

java.lang.Object
  extended by info.magnolia.cms.util.LinkUtil

public class LinkUtil
extends Object

Utility methods for links.


Constructor Summary
LinkUtil()
           
 
Method Summary
static String addFingerprintToLink(String link, Calendar lastModified)
          Insert a finger-print into a link that is based on the last modified date.
static String removeFingerprintAndExtensionFromLink(String originalPath)
          Remove the extension and fingerPrint if present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkUtil

public LinkUtil()
Method Detail

addFingerprintToLink

public static String addFingerprintToLink(String link,
                                          Calendar lastModified)
Insert a finger-print into a link that is based on the last modified date. This way we can use far future cache headers on images/assets, and simply change the filename for the asset when the asset has changed and we want browsers & proxies to take up the new asset from the server. Appends the date as a string directly before the file extension.

Parameters:
lastModified -
Returns:
The original link with the date based finger-print inserted.

removeFingerprintAndExtensionFromLink

public static String removeFingerprintAndExtensionFromLink(String originalPath)
Remove the extension and fingerPrint if present. Example: (print-logo.2012-11-20-12-15-20.pdf --> print-logo)



Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.