Skip to content

Commit

Permalink
Modified the class name from '_PhysicalFileSystemResource' into 'Phys…
Browse files Browse the repository at this point in the history
…icalFileSystemResource'
  • Loading branch information
AdrienCastex committed Jul 10, 2017
1 parent 50782df commit a09fe35
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 36 deletions.
8 changes: 4 additions & 4 deletions lib/manager/v2/instances/PhysicalFileSystem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import { LocalPropertyManager, LastModifiedDateInfo, FileSystemSerializer, OpenWriteStreamInfo, PropertyManagerInfo, OpenReadStreamInfo, IPropertyManager, LocalLockManager, CreationDateInfo, LockManagerInfo, SimpleCallback, ReturnCallback, ResourceType, ILockManager, ReadDirInfo, CreateInfo, DeleteInfo, FileSystem, SizeInfo, MoveInfo, TypeInfo } from '../fileSystem/export';
import { Readable, Writable } from 'stream';
import { Path } from '../Path';
export declare class _PhysicalFileSystemResource {
export declare class PhysicalFileSystemResource {
props: LocalPropertyManager;
locks: LocalLockManager;
constructor(data?: _PhysicalFileSystemResource);
constructor(data?: PhysicalFileSystemResource);
}
export declare class PhysicalSerializer implements FileSystemSerializer {
uid(): string;
Expand All @@ -15,12 +15,12 @@ export declare class PhysicalSerializer implements FileSystemSerializer {
export declare class PhysicalFileSystem extends FileSystem {
rootPath: string;
resources: {
[path: string]: _PhysicalFileSystemResource;
[path: string]: PhysicalFileSystemResource;
};
constructor(rootPath: string);
protected getRealPath(path: Path): {
realPath: string;
resource: _PhysicalFileSystemResource;
resource: PhysicalFileSystemResource;
};
protected _create(path: Path, ctx: CreateInfo, _callback: SimpleCallback): void;
protected _delete(path: Path, ctx: DeleteInfo, _callback: SimpleCallback): void;
Expand Down
18 changes: 9 additions & 9 deletions lib/manager/v2/instances/PhysicalFileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ var export_1 = require("../fileSystem/export");
var path_1 = require("path");
var Errors_1 = require("../../../Errors");
var fs = require("fs");
var _PhysicalFileSystemResource = (function () {
function _PhysicalFileSystemResource(data) {
var PhysicalFileSystemResource = (function () {
function PhysicalFileSystemResource(data) {
if (!data) {
this.props = new export_1.LocalPropertyManager();
this.locks = new export_1.LocalLockManager();
Expand All @@ -26,9 +26,9 @@ var _PhysicalFileSystemResource = (function () {
this.locks = new export_1.LocalLockManager();
}
}
return _PhysicalFileSystemResource;
return PhysicalFileSystemResource;
}());
exports._PhysicalFileSystemResource = _PhysicalFileSystemResource;
exports.PhysicalFileSystemResource = PhysicalFileSystemResource;
var PhysicalSerializer = (function () {
function PhysicalSerializer() {
}
Expand All @@ -55,7 +55,7 @@ var PhysicalFileSystem = (function (_super) {
var _this = _super.call(this, new PhysicalSerializer()) || this;
_this.rootPath = rootPath;
_this.resources = {
'/': new _PhysicalFileSystemResource()
'/': new PhysicalFileSystemResource()
};
return _this;
}
Expand All @@ -71,7 +71,7 @@ var PhysicalFileSystem = (function (_super) {
var realPath = this.getRealPath(path).realPath;
var callback = function (e) {
if (!e)
_this.resources[path.toString()] = new _PhysicalFileSystemResource();
_this.resources[path.toString()] = new PhysicalFileSystemResource();
else if (e)
e = Errors_1.Errors.ResourceAlreadyExists;
_callback(e);
Expand Down Expand Up @@ -115,7 +115,7 @@ var PhysicalFileSystem = (function (_super) {
if (e)
return callback(Errors_1.Errors.ResourceNotFound);
if (!resource)
_this.resources[path.toString()] = new _PhysicalFileSystemResource();
_this.resources[path.toString()] = new PhysicalFileSystemResource();
callback(null, fs.createWriteStream(null, { fd: fd }));
});
};
Expand Down Expand Up @@ -159,15 +159,15 @@ var PhysicalFileSystem = (function (_super) {
PhysicalFileSystem.prototype._lockManager = function (path, ctx, callback) {
var resource = this.resources[path.toString()];
if (!resource) {
resource = new _PhysicalFileSystemResource();
resource = new PhysicalFileSystemResource();
this.resources[path.toString()] = resource;
}
callback(null, resource.locks);
};
PhysicalFileSystem.prototype._propertyManager = function (path, ctx, callback) {
var resource = this.resources[path.toString()];
if (!resource) {
resource = new _PhysicalFileSystemResource();
resource = new PhysicalFileSystemResource();
this.resources[path.toString()] = resource;
}
callback(null, resource.props);
Expand Down
8 changes: 5 additions & 3 deletions lib/server/commands/Propfind.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ function method(arg, callback) {
var propstatError = response.ele('D:propstat');
var prop_2 = propstatError.ele('D:prop');
propstatError.ele('D:status').add(propstatStatus(WebDAVRequest_1.HTTPCodes.NotFound));
for (var i = 0; i < reqBody.leftElements.length; ++i)
if (reqBody.leftElements[i])
prop_2.ele(reqBody.leftElements[i].name);
for (var _i = 0, _a = reqBody.leftElements; _i < _a.length; _i++) {
var el = _a[_i];
if (el)
prop_2.ele(el.name);
}
}
callback();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/server/commands/Proppatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function method(arg, callback) {
arg.invokeEvent(eventName, r, el);
notify_1(el, e);
})
.done(function () { return finalize_1(); });
.done(function (_) { return finalize_1(); });
});
};
execute('DAV:set', 'setProperty', function (el, callback) {
Expand Down
8 changes: 5 additions & 3 deletions lib/server/v2/commands/Propfind.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ var default_1 = (function () {
var propstatError = response.ele('D:propstat');
var prop_2 = propstatError.ele('D:prop');
propstatError.ele('D:status').add(propstatStatus(WebDAVRequest_1.HTTPCodes.NotFound));
for (var i = 0; i < reqBody.leftElements.length; ++i)
if (reqBody.leftElements[i])
prop_2.ele(reqBody.leftElements[i].name);
for (var _i = 0, _a = reqBody.leftElements; _i < _a.length; _i++) {
var el = _a[_i];
if (el)
prop_2.ele(el.name);
}
}
callback();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/server/v2/commands/Proppatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var default_1 = (function () {
if (el.type === 'element')
notify_1(el, e);
})
.done(function () { return finalize_1(); });
.done(function (_) { return finalize_1(); });
});
};
r.fs.isLocked(ctx, r.path, function (e, locked) {
Expand Down
4 changes: 1 addition & 3 deletions lib/server/v2/webDAVServer/BeforeAfter.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { HTTPRequestContext } from '../WebDAVRequest';
export interface RequestListener {
(ctx: HTTPRequestContext, next: () => void): void;
}
export declare type RequestListener = (ctx: HTTPRequestContext, next: () => void) => void;
export declare function invokeBeforeRequest(base: HTTPRequestContext, callback: any): void;
export declare function invokeAfterRequest(base: HTTPRequestContext, callback: any): void;
2 changes: 1 addition & 1 deletion lib/server/v2/webDAVServer/WebDAVServer.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="node" />
import { WebDAVServerOptions } from '../WebDAVServerOptions';
import { ExternalRequestContext, RequestContextExternalOptions, RequestContext } from '../RequestContext';
import { WebDAVServerOptions } from '../WebDAVServerOptions';
import { HTTPMethod } from '../WebDAVRequest';
import { HTTPAuthentication } from '../../../user/v2/authentication/HTTPAuthentication';
import { PrivilegeManager } from '../../../user/v2/privilege/PrivilegeManager';
Expand Down
2 changes: 1 addition & 1 deletion lib/server/v2/webDAVServer/WebDAVServer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var WebDAVServerOptions_1 = require("../WebDAVServerOptions");
var RequestContext_1 = require("../RequestContext");
var WebDAVServerOptions_1 = require("../WebDAVServerOptions");
var Commands_1 = require("../commands/Commands");
var Path_1 = require("../../../manager/v2/Path");
var persistence = require("./Persistence");
Expand Down
18 changes: 9 additions & 9 deletions src/manager/v2/instances/PhysicalFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import { Errors } from '../../../Errors'
import { Path } from '../Path'
import * as fs from 'fs'

export class _PhysicalFileSystemResource
export class PhysicalFileSystemResource
{
props : LocalPropertyManager
locks : LocalLockManager

constructor(data ?: _PhysicalFileSystemResource)
constructor(data ?: PhysicalFileSystemResource)
{
if(!data)
{
Expand All @@ -41,7 +41,7 @@ export class _PhysicalFileSystemResource
}
else
{
const rs = data as _PhysicalFileSystemResource;
const rs = data as PhysicalFileSystemResource;
this.props = new LocalPropertyManager(rs.props);
this.locks = new LocalLockManager();
}
Expand Down Expand Up @@ -74,15 +74,15 @@ export class PhysicalSerializer implements FileSystemSerializer
export class PhysicalFileSystem extends FileSystem
{
resources : {
[path : string] : _PhysicalFileSystemResource
[path : string] : PhysicalFileSystemResource
}

constructor(public rootPath : string)
{
super(new PhysicalSerializer());

this.resources = {
'/': new _PhysicalFileSystemResource()
'/': new PhysicalFileSystemResource()
};
}

Expand All @@ -102,7 +102,7 @@ export class PhysicalFileSystem extends FileSystem

const callback = (e) => {
if(!e)
this.resources[path.toString()] = new _PhysicalFileSystemResource();
this.resources[path.toString()] = new PhysicalFileSystemResource();
else if(e)
e = Errors.ResourceAlreadyExists;

Expand Down Expand Up @@ -158,7 +158,7 @@ export class PhysicalFileSystem extends FileSystem
return callback(Errors.ResourceNotFound);

if(!resource)
this.resources[path.toString()] = new _PhysicalFileSystemResource();
this.resources[path.toString()] = new PhysicalFileSystemResource();

callback(null, fs.createWriteStream(null, { fd }));
})
Expand Down Expand Up @@ -218,7 +218,7 @@ export class PhysicalFileSystem extends FileSystem
let resource = this.resources[path.toString()];
if(!resource)
{
resource = new _PhysicalFileSystemResource();
resource = new PhysicalFileSystemResource();
this.resources[path.toString()] = resource;
}

Expand All @@ -230,7 +230,7 @@ export class PhysicalFileSystem extends FileSystem
let resource = this.resources[path.toString()];
if(!resource)
{
resource = new _PhysicalFileSystemResource();
resource = new PhysicalFileSystemResource();
this.resources[path.toString()] = resource;
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/webDAVServer/BeforeAfter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export function invokeBeforeRequest(base : MethodCallArgs, callback)
export function invokeAfterRequest(base : MethodCallArgs, callback)
{
invokeBARequest(this.afterManagers, base, callback);
}
}

0 comments on commit a09fe35

Please sign in to comment.