Private
Readonly
BUFFER_Private
Readonly
activationsPrivate
activeProtected
Readonly
contributionsPrivate
correlationProtected
Readonly
encodingProtected
Readonly
encodingProtected
Readonly
labelReadonly
onPrivate
onReadonly
onPrivate
onReadonly
onPrivate
onReadonly
onAn event that is emitted when file operation is failed. This event is triggered by user gestures.
Private
Readonly
onPrivate
onReadonly
onAn event that is emitted when operation is finished. This event is triggered by user gestures and programmatically.
Private
onReadonly
onAn event that is emitted when file operation is finished. This event is triggered by user gestures.
Private
Readonly
onReadonly
onSee FileServiceContribution.registerProviders
.
Private
onReadonly
onAn event that is emitted when file operation is being performed. This event is triggered by user gestures.
Private
Readonly
onPrivate
Readonly
participantsProtected
Readonly
preferencesProtected
Readonly
progressPrivate
Readonly
providersProtected
Readonly
watcherPrivate
writeAn event that is emitted when files are changed on the disk.
Tests a user's permissions for the given resource.
URI
of the resource which should be tested.
Optional
mode: numberAn optional integer that specifies the accessibility checks to be performed.
Check FileAccess.Constants
for possible values of mode.
It is possible to create a mask consisting of the bitwise OR
of two or more values (e.g. FileAccess.Constants.W_OK | FileAccess.Constants.R_OK).
If mode
is not defined, FileAccess.Constants.F_OK
will be used instead.
Try to activate the registered provider for the given scheme
The uri scheme for which the responsible provider should be activated.
A promise of the activated file system provider. Only resolves if a provider is available for this scheme, gets rejected otherwise.
Protected
asOptional
options: ReadFileOptions & WriteFileOptions & CreateFileOptionsTests if the service (i.e. any of its registered FileSystemProviders) can handle the given resource.
URI
of the resource to test.
true
if the resource can be handled, false
otherwise.
Optional
options: CopyFileOptionsOptional
value: string | Readable<string>Optional
options: CreateTextFileOptionsOptional
options: CreateFileOptionsOptional
options: FileOperationOptions & Partial<FileDeleteOptions>Protected
doOptional
overwrite: booleanPrivate
doPrivate
doProtected
doOptional
value: string | Readable<string>Optional
options: CreateTextFileOptionsProtected
doOptional
options: Partial<FileDeleteOptions>Protected
doOptional
overwrite: booleanPrivate
doPrivate
doPrivate
doPrivate
doPrivate
doPrivate
doPrivate
doPrivate
doPrivate
doOptional
options: ReadTextFileOptions & { Private
doOptional
options: ReadFileOptions & { Private
doOptional
options: ResolveFileOptionsPrivate
doOptional
overwrite: booleanPrivate
doPrivate
doPrivate
doPrivate
doPrivate
doPrivate
doPrivate
ensureTests if the given resource exists in the filesystem.
URI
of the resource which should be tested.
A promise that resolves to true
if the resource exists.
Will throw an error if no FileSystemProvider is registered for the given resource.
Resolves the fs path of the given URI.
USE WITH CAUTION: You should always prefer URIs to paths if possible, as they are portable and platform independent. Paths should only be used in cases you directly interact with the OS, e.g. when running a command on the shell.
If you need to display human readable simple or long names then use LabelProvider
instead.
URI
of the resource that should be resolved.
A promise of the resolved fs path.
Will throw an error if no FileSystemProvider is registered for the given resource.
Protected
getProtected
getOptional
options: ReadEncodingOptionsOptional
detectedEncoding: stringProtected
getOptional
options: WriteEncodingOptionsProtected
handleTests if the service (i.e the FileSystemProvider registered for the given uri scheme) provides the given capability.
URI
of the resource to test.
The required capability.
true
if the resource can be handled and the required capability can be provided.
Protected
initList the schemes and capabilities for registered file system providers
Private
mkdirpProtected
modifiedDirty write prevention: if the file on disk has been changed and does not match our expected mtime and etag, we bail out to prevent dirty writing.
First, we check for a mtime that is in the future before we do more checks. The assumption is that only the mtime is an indicator for a file that has changed on disk.
Second, if the mtime has advanced, we compare the size of the file on disk with our previous one using the etag() function. Relying only on the mtime check has proven to produce false positives due to file system weirdness (especially around remote file systems). As such, the check for size is a weaker check because it can return a false negative if the file has changed but to the same length. This is a compromise we take to avoid having to produce checksums of the file content for comparison which would be much slower to compute.
Optional
options: WriteFileOptionsOptional
options: MoveFileOptionsPrivate
progressOptional
options: ReadTextFileOptionsOptional
options: ReadFileOptionsPrivate
readOptional
options: ReadFileOptionsPrivate
readPrivate
readOptional
options: ReadFileOptionsOptional
options: ReadTextFileOptionsRegisters a new FileSystemProvider for the given scheme.
The (uri) scheme for which the provider should be registered.
The file system provider that should be registered.
A Disposable
that can be invoked to unregister the given provider.
Try to resolve file information and metadata for the given resource.
URI
of the resource that should be resolved.
Options to customize the resolvement process.
A promise that resolves if the resource could be successfully resolved.
Optional
options: ResolveFileOptionsTry to resolve file information and metadata for all given resource.
An array of all the resources (and corresponding resolvement options) that should be resolved.
A promise of all resolved resources. The promise is not rejected if any of the given resources cannot be resolved.
Instead this is reflected with the success
flag of the corresponding ResolveFileResult.
Protected
resolveOptional
options: ReadTextFileOptionsPrivate
resourceProtected
rethrowOptional
options: ReadFileOptions & WriteFileOptions & CreateFileOptionsProtected
shouldOptional
options: ReadFileOptionsProtected
throwPrivate
toOptional
siblings: numberOptional
siblings: numberPrivate
toPrivate
toPrivate
validateOptional
options: ReadFileOptionsPrivate
validateOptional
options: ReadFileOptionsPrivate
validateOptional
options: WriteFileOptionsProtected
withPrivate
withPrivate
withOptional
options: WriteTextFileOptionsOptional
options: WriteFileOptions
The FileService is the common facade responsible for all interactions with file systems. It manages all registered FileSystemProviders and forwards calls to the responsible FileSystemProvider, determined by the scheme. For additional documentation regarding the provided functions see also FileSystemProvider.