@Service(value="blDefaultFileServiceProvider") public class FileSystemFileServiceProvider extends Object implements FileServiceProvider
| Modifier and Type | Field and Description |
|---|---|
protected String |
baseDirectory |
protected String |
fileSystemBaseDirectory |
protected int |
maxGeneratedDirectoryDepth |
| Constructor and Description |
|---|
FileSystemFileServiceProvider() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
@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
public File getResource(String name)
FileServiceProvidergetResource in interface FileServiceProvidername - - fully qualified path to the resourcepublic File getResource(String name, FileApplicationType applicationType)
FileServiceProvidergetResource in interface FileServiceProvidername - - fully qualified path to the resourceapplicationType - - applicationTypepublic void addOrUpdateResources(FileWorkArea area, List<File> files, boolean removeResourcesFromWorkArea)
FileServiceProvideraddOrUpdateResources in interface FileServiceProviderpublic boolean removeResource(String name)
FileServiceProviderremoveResource in interface FileServiceProvidername - - fully qualified path to the resourceprotected 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 '/';Copyright © 2014. All Rights Reserved.