|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.common.file.service.FileSystemFileServiceProvider
@Service(value="blDefaultFileServiceProvider") public class FileSystemFileServiceProvider
Default implementation of FileServiceProvider that uses the local file system to store files created by Broadleaf components. This Provider can only be used in production systems that run on a single server or those that have a shared filesystem mounted to the application servers.
| Field Summary | |
|---|---|
protected String |
baseDirectory
|
protected String |
fileSystemBaseDirectory
|
protected int |
maxGeneratedDirectoryDepth
|
| Constructor Summary | |
|---|---|
FileSystemFileServiceProvider()
|
|
| Method Summary | |
|---|---|
void |
addOrUpdateResources(FileWorkArea area,
List<File> files,
boolean removeResourcesFromWorkArea)
Takes in a work area and application type and moves all of the files to the configured FileProvider. |
protected String |
buildResourceName(String url)
Stores the file on the file-system by performing an MD5 hash of the the passed in fileName To ensure that files can be stored and accessed in an efficient manner, the system creates directories based on the characters in the hash. |
protected String |
getBaseDirectory()
Returns a base directory (unique for each tenant in a multi-tenant installation. |
File |
getResource(String name)
Returns a File representing the passed in name. |
File |
getResource(String name,
FileApplicationType applicationType)
Returns a File representing the passed in name and application type. |
protected String |
getSiteDirectory(String baseDirectory)
Creates a unique directory on the file system for each site. |
boolean |
removeResource(String name)
Removes the resource from the file service. |
| 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 fileSystemBaseDirectory
@Value(value="${asset.server.max.generated.file.system.directories}")
protected int maxGeneratedDirectoryDepth
protected String baseDirectory
| Constructor Detail |
|---|
public FileSystemFileServiceProvider()
| Method Detail |
|---|
public File getResource(String name)
FileServiceProvider
getResource in interface FileServiceProvidername - - fully qualified path to the resource
public File getResource(String name,
FileApplicationType applicationType)
FileServiceProvider
getResource in interface FileServiceProvidername - - fully qualified path to the resourceapplicationType - - applicationType
public void addOrUpdateResources(FileWorkArea area,
List<File> files,
boolean removeResourcesFromWorkArea)
FileServiceProvider
addOrUpdateResources in interface FileServiceProviderpublic boolean removeResource(String name)
FileServiceProvider
removeResource in interface FileServiceProvidername - - fully qualified path to the resource
protected String buildResourceName(String url)
url - The URL used to represent an asset for which a name on the fileSystem is desired.
protected String getBaseDirectory()
protected String getSiteDirectory(String baseDirectory)
The - starting directory for local files which must end with a '/';
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||