ro.isdc.wro.model.resource.support.naming
Class TimestampNamingStrategy

java.lang.Object
  extended by ro.isdc.wro.model.resource.support.naming.TimestampNamingStrategy
All Implemented Interfaces:
NamingStrategy

public class TimestampNamingStrategy
extends Object
implements NamingStrategy

This naming strategy append a timestamp to the name of the file. This is especially useful when wro4j is used at build time with the maven plugin.

Since:
1.4.3
Author:
Julien Wajsberg

Field Summary
static String ALIAS
          Alias used identify this implementation when configuring which NamingStrategy to use.
 
Constructor Summary
TimestampNamingStrategy()
           
 
Method Summary
protected  long getTimestamp()
           
 String rename(String originalName, InputStream inputStream)
          Creates a new name of the resource which encodes a version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS

public static final String ALIAS
Alias used identify this implementation when configuring which NamingStrategy to use.

See Also:
Constant Field Values
Constructor Detail

TimestampNamingStrategy

public TimestampNamingStrategy()
Method Detail

rename

public String rename(String originalName,
                     InputStream inputStream)
Creates a new name of the resource which encodes a version.

Specified by:
rename in interface NamingStrategy
Parameters:
originalName - original name of the resource.
inputStream - the stream of the content to rename.
Returns:
new name of the resource with version encoded.

getTimestamp

protected long getTimestamp()


Copyright © 2008-2013. All Rights Reserved.