org.broadleafcommerce.cms.file.service
Class StaticAssetStorageServiceImpl

java.lang.Object
  extended by org.broadleafcommerce.cms.file.service.StaticAssetStorageServiceImpl
All Implemented Interfaces:
StaticAssetStorageService

@Service(value="blStaticAssetStorageService")
public class StaticAssetStorageServiceImpl
extends Object
implements StaticAssetStorageService

Author:
Jeff Fischer

Nested Class Summary
static class StaticAssetStorageServiceImpl.CleanupOperation
           
 
Field Summary
protected  ArtifactService artifactService
           
protected  String cacheDirectory
           
protected  Thread cleanupThread
           
protected  boolean cleanupThreadEnabled
           
protected  StaticAssetService staticAssetService
           
protected  StaticAssetStorageDao staticAssetStorageDao
           
 
Constructor Summary
StaticAssetStorageServiceImpl()
           
 
Method Summary
protected  void clearObsoleteCacheFiles(StaticAsset staticAsset, File cacheFile)
           
protected  String constructCacheFileName(StaticAsset staticAsset, Map<String,String> parameterMap)
           
 StaticAssetStorage create()
           
 Blob createBlob(org.springframework.web.multipart.MultipartFile uploadedFile)
           
protected  void createCacheFile(InputStream is, File cacheFile)
           
 void delete(StaticAssetStorage assetStorage)
           
 void destroy()
           
protected  StaticAsset findStaticAsset(String fullUrl, SandBox sandBox)
           
 StaticAssetStorage findStaticAssetStorageById(Long id)
           
 String getCacheDirectory()
           
 Map<String,String> getCacheFileModel(String fullUrl, SandBox sandBox, Map<String,String> parameterMap)
           
 boolean isCleanupThreadEnabled()
           
protected  String pad(String s, int length, char pad)
           
 StaticAssetStorage readStaticAssetStorageByStaticAssetId(Long id)
           
 StaticAssetStorage save(StaticAssetStorage assetStorage)
           
 void setCacheDirectory(String cacheDirectory)
           
 void setCleanupThreadEnabled(boolean cleanupThreadEnabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheDirectory

protected String cacheDirectory

cleanupThreadEnabled

protected boolean cleanupThreadEnabled

staticAssetService

protected StaticAssetService staticAssetService

artifactService

protected ArtifactService artifactService

staticAssetStorageDao

protected StaticAssetStorageDao staticAssetStorageDao

cleanupThread

protected Thread cleanupThread
Constructor Detail

StaticAssetStorageServiceImpl

public StaticAssetStorageServiceImpl()
Method Detail

destroy

@PreDestroy
public void destroy()

findStaticAsset

protected StaticAsset findStaticAsset(String fullUrl,
                                      SandBox sandBox)

getCacheFileModel

public Map<String,String> getCacheFileModel(String fullUrl,
                                            SandBox sandBox,
                                            Map<String,String> parameterMap)
                                     throws Exception
Specified by:
getCacheFileModel in interface StaticAssetStorageService
Throws:
Exception

findStaticAssetStorageById

public StaticAssetStorage findStaticAssetStorageById(Long id)
Specified by:
findStaticAssetStorageById in interface StaticAssetStorageService

create

public StaticAssetStorage create()
Specified by:
create in interface StaticAssetStorageService

readStaticAssetStorageByStaticAssetId

public StaticAssetStorage readStaticAssetStorageByStaticAssetId(Long id)
Specified by:
readStaticAssetStorageByStaticAssetId in interface StaticAssetStorageService

save

public StaticAssetStorage save(StaticAssetStorage assetStorage)
Specified by:
save in interface StaticAssetStorageService

delete

public void delete(StaticAssetStorage assetStorage)
Specified by:
delete in interface StaticAssetStorageService

createBlob

public Blob createBlob(org.springframework.web.multipart.MultipartFile uploadedFile)
                throws IOException
Specified by:
createBlob in interface StaticAssetStorageService
Throws:
IOException

clearObsoleteCacheFiles

protected void clearObsoleteCacheFiles(StaticAsset staticAsset,
                                       File cacheFile)

createCacheFile

protected void createCacheFile(InputStream is,
                               File cacheFile)
                        throws SQLException,
                               IOException
Throws:
SQLException
IOException

constructCacheFileName

protected String constructCacheFileName(StaticAsset staticAsset,
                                        Map<String,String> parameterMap)

pad

protected String pad(String s,
                     int length,
                     char pad)

getCacheDirectory

public String getCacheDirectory()

setCacheDirectory

public void setCacheDirectory(String cacheDirectory)

isCleanupThreadEnabled

public boolean isCleanupThreadEnabled()

setCleanupThreadEnabled

public void setCleanupThreadEnabled(boolean cleanupThreadEnabled)


Copyright © 2012. All Rights Reserved.