Skip to content

Commit

Permalink
Added the 'isLocked' method in the 'Resource' class and in the 'Conte…
Browse files Browse the repository at this point in the history
…xtualFileSystem' class
  • Loading branch information
AdrienCastex committed Jul 3, 2017
1 parent 7f7a3cd commit 7e3a142
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/manager/v2/fileSystem/ContextualFileSystem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export declare class ContextualFileSystem implements ISerializableFileSystem {
listDeepLocks(startPath: Path | string, depth: number, callback: ReturnCallback<{
[path: string]: Lock[];
}>): any;
isLocked(path: Path | string, callback: ReturnCallback<boolean>): any;
isLocked(path: Path | string, depth: number, callback: ReturnCallback<boolean>): any;
serializer(): FileSystemSerializer;
serialize(callback: (serializedData: any) => void): void;
}
3 changes: 3 additions & 0 deletions lib/manager/v2/fileSystem/ContextualFileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ var ContextualFileSystem = (function () {
ContextualFileSystem.prototype.listDeepLocks = function (startPath, _depth, _callback) {
this.fs.listDeepLocks(this.context, startPath, _depth, _callback);
};
ContextualFileSystem.prototype.isLocked = function (path, _depth, _callback) {
this.fs.isLocked(this.context, path, _depth, _callback);
};
ContextualFileSystem.prototype.serializer = function () {
return this.fs.serializer();
};
Expand Down
2 changes: 2 additions & 0 deletions lib/manager/v2/fileSystem/Resource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ export declare class Resource {
listDeepLocks(depth: number, callback: ReturnCallback<{
[path: string]: Lock[];
}>): any;
isLocked(callback: ReturnCallback<boolean>): any;
isLocked(depth: number, callback: ReturnCallback<boolean>): any;
}
3 changes: 3 additions & 0 deletions lib/manager/v2/fileSystem/Resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ var Resource = (function () {
Resource.prototype.listDeepLocks = function (_depth, _callback) {
this.fs.listDeepLocks(this.context, this.path, _depth, _callback);
};
Resource.prototype.isLocked = function (_depth, _callback) {
this.fs.isLocked(this.context, this.path, _depth, _callback);
};
return Resource;
}());
exports.Resource = Resource;
7 changes: 7 additions & 0 deletions src/manager/v2/fileSystem/ContextualFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ export class ContextualFileSystem implements ISerializableFileSystem
this.fs.listDeepLocks(this.context, startPath, _depth, _callback);
}

isLocked(path : Path | string, callback : ReturnCallback<boolean>)
isLocked(path : Path | string, depth : number, callback : ReturnCallback<boolean>)
isLocked(path : Path | string, _depth : any, _callback ?: ReturnCallback<boolean>)
{
this.fs.isLocked(this.context, path, _depth, _callback);
}

serializer() : FileSystemSerializer
{
return this.fs.serializer();
Expand Down
7 changes: 7 additions & 0 deletions src/manager/v2/fileSystem/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,11 @@ export class Resource
{
this.fs.listDeepLocks(this.context, this.path, _depth, _callback);
}

isLocked(callback : ReturnCallback<boolean>)
isLocked(depth : number, callback : ReturnCallback<boolean>)
isLocked(_depth : any, _callback ?: ReturnCallback<boolean>)
{
this.fs.isLocked(this.context, this.path, _depth, _callback);
}
}

0 comments on commit 7e3a142

Please sign in to comment.