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

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

Deprecated. prefer Using DefaultHashEncoderNamingStrategy.

public class HashEncoderNamingStrategy
extends Object
implements NamingStrategy

The simplest implementation of NamingStrategy which encodes the hash code into the name of the resource. For instance: For group.js -> group-.js. This implementation uses by default CRC32HashBuilder implementation.

Author:
Alex Objelean

Field Summary
static String ALIAS
          Deprecated.  
 
Constructor Summary
HashEncoderNamingStrategy()
          Deprecated.  
 
Method Summary
protected  HashStrategy getHashStrategy()
          Deprecated.  
protected  HashStrategy newHashStrategy()
          Deprecated.  
 String rename(String originalName, InputStream inputStream)
          Deprecated. 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
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

HashEncoderNamingStrategy

public HashEncoderNamingStrategy()
Deprecated. 
Method Detail

newHashStrategy

protected HashStrategy newHashStrategy()
Deprecated. 
Returns:
an implementation of HashStrategy.

getHashStrategy

protected HashStrategy getHashStrategy()
Deprecated. 
Returns:
the HashStrategy to use for renaming. By default the used strategy is the same as the one configured by wro4j. Override this method to provide a custom HashStrategy.

rename

public String rename(String originalName,
                     InputStream inputStream)
              throws IOException
Deprecated. 
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.
Throws:
IOException - if there are stream reading problem.


Copyright © 2008-2013. All Rights Reserved.