Class FileSystemResourceProvider
java.lang.Object
org.exoplatform.commons.file.resource.FileSystemResourceProvider
- All Implemented Interfaces:
BinaryProvider
This class provide file system implementation of the File RDBMS API.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileSystemResourceProvider(String rootPath) FileSystemResourceProvider(org.exoplatform.container.xml.InitParams initParams) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbyte[]final FilegetFilePath(String name) getFilePath(FileInfo fileInfo) getRoot()inthashCode()longlastModified(String name) voidvoidput(String name, InputStream data) Write a file to the file system.voidvoidbooleantoString()
-
Field Details
-
root
-
-
Constructor Details
-
Method Details
-
getRoot
-
getFile
- Throws:
IOException
-
exists
- Specified by:
existsin interfaceBinaryProvider- Throws:
IOException
-
lastModified
- Specified by:
lastModifiedin interfaceBinaryProvider- Throws:
IOException
-
getURL
- Specified by:
getURLin interfaceBinaryProvider
-
getBytes
- Specified by:
getBytesin interfaceBinaryProvider
-
getStream
- Specified by:
getStreamin interfaceBinaryProvider
-
getFilePath
- Specified by:
getFilePathin interfaceBinaryProvider- Throws:
IOException
-
getFilePath
- Specified by:
getFilePathin interfaceBinaryProvider- Throws:
IOException
-
remove
- Specified by:
removein interfaceBinaryProvider- Throws:
IOException
-
remove
- Specified by:
removein interfaceBinaryProvider- Throws:
IOException
-
put
- Specified by:
putin interfaceBinaryProvider- Throws:
IOException
-
put
Write a file to the file system. The path is build with the root path, and from the checksum of the file. The folder levels are built from the checkum, and it is also used for the filename. This allows to never update a file, meaning there will be no concurrent issue when creating or updating a file. If a file with the same path already exists, it means that this is the same file and there is no need to update it. If a file with the same path does not exist, the file can be created since it is a nex file or it is an update with a different file binary. This implies that no deletion of old file versions are done on the fly. A scheduled job is needed for that.- Specified by:
putin interfaceBinaryProvider- Parameters:
name- file name.data- inputStream- Throws:
IOException- ignals that an I/O exception of some sort has occurred.
-
put
- Specified by:
putin interfaceBinaryProvider- Throws:
IOException
-
getLocation
- Specified by:
getLocationin interfaceBinaryProvider
-
equals
-
hashCode
public int hashCode() -
toString
-