com.github.cloudfiles.localfs
Members list
Type members
Classlikes
A ''FileSystem'' implementation to manipulate files and folders on a local hard disk.
A ''FileSystem'' implementation to manipulate files and folders on a local hard disk.
This implementation is a bit special, as most of its operations use neither the implicit ''ActorSystem'' nor the actor for sending HTTP requests. (Only the operations that write the content of a file use a stream which depends on the actor system.) Rather, the implementation makes use of Java's ''Path'' and ''Files'' API. These API calls are wrapped in ''Future'' objects that run on the ''ExecutionContext'' defined in the associated LocalFsConfig.
Value parameters
- config
-
the configuration for this file system
Attributes
- Supertypes
-
trait ExtensibleFileSystem[Path, LocalFile, LocalFolder, FolderContent[Path, LocalFile, LocalFolder]]trait AutoCloseableclass Objecttrait Matchableclass AnyShow all
The configuration class for the local file system implementation.
The configuration class for the local file system implementation.
The most important property is the base path of the local file system. Relative paths are resolved against this root folder. As the ''FileSystem'' API accepts arbitrary paths, it is possible to manipulate elements that are not in the sub tree spawned by the base path. Depending on the context of an application, this may be a security issue. To prevent this, this configuration supports an option to enable a mode in which paths are sanitized; this option is '''true''' per default. In this mode, all paths passed to the file system are normalized, and it is checked whether they are actually sub paths of the base path. If this check fails, the operation fails with an exception.
As the file system implementation typically uses blocking operations, a dedicated ''ExecutionContext'' has to be provided. This is to force the user to think about this option, because simply using the execution context of an already available actor system may not be the best option.
Value parameters
- basePath
-
the base path of the file system; this should be an absolute path
- executionContext
-
the execution context
- linkOptions
-
options for dealing with links
- sanitizePaths
-
flag whether paths should be checked against the base path
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LocalFsModel.type