|
||||||||||
| 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 BroadleafFileService |
broadleafFileService
|
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 |
appendTrailingSlash(String path)
Removes trailing "/" and ensures that there is a beginning "/" |
protected Map<String,String> |
buildModel(String returnFilePath,
String mimeType)
|
protected String |
constructCacheFileName(StaticAsset staticAsset,
Map<String,String> parameterMap)
Builds a file system path for the passed in static asset and paramaterMap. |
StaticAssetStorage |
create()
|
Blob |
createBlob(org.springframework.web.multipart.MultipartFile uploadedFile)
|
protected void |
createLocalFileFromClassPathResource(StaticAsset staticAsset,
File baseLocalFile)
|
protected void |
createLocalFileFromInputStream(InputStream is,
File baseLocalFile)
|
void |
createStaticAssetStorageFromFile(org.springframework.web.multipart.MultipartFile file,
StaticAsset staticAsset)
Persists the file to the DB or FileSystem according to the staticAsset's StorageType. |
void |
delete(StaticAssetStorage assetStorage)
Removes a static asset from the database. |
protected StaticAsset |
findStaticAsset(String fullUrl)
|
StaticAssetStorage |
findStaticAssetStorageById(Long id)
Returns a StaticAssetStorage object. |
Map<String,String> |
getCacheFileModel(String fullUrl,
Map<String,String> parameterMap)
|
protected File |
getFileFromLocalRepository(String cachedFileName)
|
protected File |
lookupAssetAndCreateLocalFile(StaticAsset staticAsset,
File baseLocalFile)
|
protected String |
pad(String s,
int length,
char pad)
|
StaticAssetStorage |
readStaticAssetStorageByStaticAssetId(Long id)
Returns a StaticAssetStorage object using the id of a related StaticAsset. |
protected String |
removeLeadingSlash(String path)
Removes trailing "/" and ensures that there is a beginning "/" |
StaticAssetStorage |
save(StaticAssetStorage assetStorage)
Persists a static asset to the database. |
protected boolean |
shouldUseSharedFile(InputStream is)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@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 BroadleafFileService broadleafFileService
protected ArtifactService artifactService
protected StaticAssetStorageDao staticAssetStorageDao
protected NamedOperationManager namedOperationManager
| Constructor Detail |
|---|
public StaticAssetStorageServiceImpl()
| Method Detail |
|---|
protected StaticAsset findStaticAsset(String fullUrl)
protected String appendTrailingSlash(String path)
path -
protected String removeLeadingSlash(String path)
path -
protected boolean shouldUseSharedFile(InputStream is)
protected File getFileFromLocalRepository(String cachedFileName)
protected File lookupAssetAndCreateLocalFile(StaticAsset staticAsset,
File baseLocalFile)
throws IOException,
SQLException
IOException
SQLException
protected void createLocalFileFromClassPathResource(StaticAsset staticAsset,
File baseLocalFile)
throws IOException
IOException
protected void createLocalFileFromInputStream(InputStream is,
File baseLocalFile)
throws IOException
IOException
@Transactional(value="blTransactionManagerAssetStorageInfo")
public Map<String,String> getCacheFileModel(String fullUrl,
Map<String,String> parameterMap)
throws Exception
getCacheFileModel in interface StaticAssetStorageServiceException
protected Map<String,String> buildModel(String returnFilePath,
String mimeType)
@Transactional(value="blTransactionManagerAssetStorageInfo") public StaticAssetStorage findStaticAssetStorageById(Long id)
StaticAssetStorageService
findStaticAssetStorageById in interface StaticAssetStorageService@Transactional(value="blTransactionManagerAssetStorageInfo") public StaticAssetStorage create()
create in interface StaticAssetStorageService@Transactional(value="blTransactionManagerAssetStorageInfo") public StaticAssetStorage readStaticAssetStorageByStaticAssetId(Long id)
StaticAssetStorageService
readStaticAssetStorageByStaticAssetId in interface StaticAssetStorageService@Transactional(value="blTransactionManagerAssetStorageInfo") public StaticAssetStorage save(StaticAssetStorage assetStorage)
StaticAssetStorageService
save in interface StaticAssetStorageService@Transactional(value="blTransactionManagerAssetStorageInfo") public void delete(StaticAssetStorage assetStorage)
StaticAssetStorageService
delete in interface StaticAssetStorageService
@Transactional(value="blTransactionManagerAssetStorageInfo")
public Blob createBlob(org.springframework.web.multipart.MultipartFile uploadedFile)
throws IOException
createBlob in interface StaticAssetStorageServiceIOException
protected String constructCacheFileName(StaticAsset staticAsset,
Map<String,String> parameterMap)
staticAsset - parameterMap - useSharedFile -
protected String pad(String s,
int length,
char pad)
@Transactional(value="blTransactionManagerAssetStorageInfo")
public void createStaticAssetStorageFromFile(org.springframework.web.multipart.MultipartFile file,
StaticAsset staticAsset)
throws IOException
StaticAssetStorageService
createStaticAssetStorageFromFile in interface StaticAssetStorageServiceIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||