|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.cms.file.service.StaticAssetStorageServiceImpl
@Service(value="blStaticAssetStorageService") public class StaticAssetStorageServiceImpl
| Field Summary | |
|---|---|
protected ArtifactService |
artifactService
|
protected String |
assetFileClasspathDirectory
|
protected String |
assetFileSystemPath
|
protected int |
assetServerMaxGeneratedDirectories
|
protected String |
cacheDirectory
|
protected int |
fileBufferSize
|
protected long |
maxUploadableFileSize
|
protected NamedOperationManager |
namedOperationManager
|
protected StaticAssetService |
staticAssetService
|
protected StaticAssetStorageDao |
staticAssetStorageDao
|
| Constructor Summary | |
|---|---|
StaticAssetStorageServiceImpl()
|
|
| Method Summary | |
|---|---|
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 |
createStaticAssetStorageFromFile(org.springframework.web.multipart.MultipartFile file,
StaticAsset staticAsset)
Persists the file being based in according to the staticAsset's StorageType. |
void |
delete(StaticAssetStorage assetStorage)
|
protected InputStream |
findInputStreamForStaticAsset(StaticAsset staticAsset)
|
protected StaticAsset |
findStaticAsset(String fullUrl,
SandBox sandBox)
|
StaticAssetStorage |
findStaticAssetStorageById(Long id)
|
protected String |
fixPath(String path)
Removes trailing "/" and ensures that there is a beginning "/" |
String |
generateStorageFileName(StaticAsset staticAsset)
By default, delegates a call to StaticAssetStorageService.generateStorageFileName(String) using staticAsset.getFullUrl()
as the passed in argument. |
String |
generateStorageFileName(String fullUrl)
Stores the file on the filesystem by performing an MD5 hash of the the staticAsset.fullUrl. |
protected String |
getBaseDirectory()
Returns the baseDirectory for writing and reading files as the property assetFileSystemPath if it exists or java.tmp.io if that property has not been set. |
Map<String,String> |
getCacheFileModel(String fullUrl,
SandBox sandBox,
Map<String,String> parameterMap)
|
protected InputStream |
getResourceFromClasspath(StaticAsset staticAsset)
|
static void |
main(String[] args)
|
protected String |
pad(String s,
int length,
char pad)
|
StaticAssetStorage |
readStaticAssetStorageByStaticAssetId(Long id)
|
StaticAssetStorage |
save(StaticAssetStorage assetStorage)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Value(value="${asset.server.file.system.path}")
protected String assetFileSystemPath
@Value(value="${asset.server.file.classpath.directory}")
protected String assetFileClasspathDirectory
@Value(value="${asset.server.max.generated.file.system.directories}")
protected int assetServerMaxGeneratedDirectories
@Value(value="${asset.server.max.uploadable.file.size}")
protected long maxUploadableFileSize
@Value(value="${asset.server.file.buffer.size}")
protected int fileBufferSize
protected String cacheDirectory
protected StaticAssetService staticAssetService
protected ArtifactService artifactService
protected StaticAssetStorageDao staticAssetStorageDao
protected NamedOperationManager namedOperationManager
| Constructor Detail |
|---|
public StaticAssetStorageServiceImpl()
| Method Detail |
|---|
protected StaticAsset findStaticAsset(String fullUrl,
SandBox sandBox)
protected String fixPath(String path)
path -
public String generateStorageFileName(StaticAsset staticAsset)
StaticAssetStorageServiceStaticAssetStorageService.generateStorageFileName(String) using staticAsset.getFullUrl()
as the passed in argument.
generateStorageFileName in interface StaticAssetStorageServicestaticAsset - StaticAsset for which a filename is desired.
protected String getBaseDirectory()
public String generateStorageFileName(String fullUrl)
StaticAssetStorageService
generateStorageFileName in interface StaticAssetStorageServicefullUrl - The URL used to represent an asset for which a name on the fileSystem is desired.
@Transactional(value="blTransactionManagerAssetStorageInfo")
public Map<String,String> getCacheFileModel(String fullUrl,
SandBox sandBox,
Map<String,String> parameterMap)
throws Exception
getCacheFileModel in interface StaticAssetStorageServiceException
protected InputStream findInputStreamForStaticAsset(StaticAsset staticAsset)
throws SQLException,
IOException
SQLException
IOExceptionprotected InputStream getResourceFromClasspath(StaticAsset staticAsset)
@Transactional(value="blTransactionManagerAssetStorageInfo") public StaticAssetStorage findStaticAssetStorageById(Long id)
findStaticAssetStorageById in interface StaticAssetStorageService@Transactional(value="blTransactionManagerAssetStorageInfo") public StaticAssetStorage create()
create in interface StaticAssetStorageService@Transactional(value="blTransactionManagerAssetStorageInfo") public StaticAssetStorage readStaticAssetStorageByStaticAssetId(Long id)
readStaticAssetStorageByStaticAssetId in interface StaticAssetStorageService@Transactional(value="blTransactionManagerAssetStorageInfo") public StaticAssetStorage save(StaticAssetStorage assetStorage)
save in interface StaticAssetStorageService@Transactional(value="blTransactionManagerAssetStorageInfo") public void delete(StaticAssetStorage assetStorage)
delete in interface StaticAssetStorageService
@Transactional(value="blTransactionManagerAssetStorageInfo")
public Blob createBlob(org.springframework.web.multipart.MultipartFile uploadedFile)
throws IOException
createBlob in interface StaticAssetStorageServiceIOException
protected void createCacheFile(InputStream is,
File cacheFile)
throws SQLException,
IOException
SQLException
IOException
protected String constructCacheFileName(StaticAsset staticAsset,
Map<String,String> parameterMap)
protected String pad(String s,
int length,
char pad)
public void createStaticAssetStorageFromFile(org.springframework.web.multipart.MultipartFile file,
StaticAsset staticAsset)
throws IOException
StaticAssetStorageService
createStaticAssetStorageFromFile in interface StaticAssetStorageServiceIOExceptionpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||