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

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

public class FolderHashEncoderNamingStrategy
extends Object
implements NamingStrategy

Encodes the hash into the folder where the resources is located. Example: original name: group.js renamed: a912810be321/group.js

Since:
1.4.9
Author:
Alex Objelean

Field Summary
static String ALIAS
           
 
Constructor Summary
FolderHashEncoderNamingStrategy()
           
 
Method Summary
protected  HashStrategy getHashStrategy()
           
 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
See Also:
Constant Field Values
Constructor Detail

FolderHashEncoderNamingStrategy

public FolderHashEncoderNamingStrategy()
Method Detail

getHashStrategy

protected HashStrategy getHashStrategy()
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
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.