-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitted the 'WebDAVServer' class file into smaller files
- Loading branch information
1 parent
8f8af70
commit 1f1d13c
Showing
31 changed files
with
1,658 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { MethodCallArgs, WebDAVRequest } from '../WebDAVRequest'; | ||
export declare function beforeRequest(manager: WebDAVRequest): void; | ||
export declare function afterRequest(manager: WebDAVRequest): void; | ||
export declare function invokeBARequest(collection: WebDAVRequest[], base: MethodCallArgs, callback: any): void; | ||
export declare function invokeBeforeRequest(base: MethodCallArgs, callback: any): void; | ||
export declare function invokeAfterRequest(base: MethodCallArgs, callback: any): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function beforeRequest(manager) { | ||
this.beforeManagers.push(manager); | ||
} | ||
exports.beforeRequest = beforeRequest; | ||
function afterRequest(manager) { | ||
this.afterManagers.push(manager); | ||
} | ||
exports.afterRequest = afterRequest; | ||
function invokeBARequest(collection, base, callback) { | ||
function callCallback() { | ||
if (callback) | ||
process.nextTick(callback); | ||
} | ||
if (collection.length === 0) { | ||
callCallback(); | ||
return; | ||
} | ||
base.callback = next; | ||
var nb = collection.length + 1; | ||
function next() { | ||
--nb; | ||
if (nb === 0) { | ||
callCallback(); | ||
} | ||
else | ||
process.nextTick(function () { return collection[collection.length - nb](base, next); }); | ||
} | ||
next(); | ||
} | ||
exports.invokeBARequest = invokeBARequest; | ||
function invokeBeforeRequest(base, callback) { | ||
this.invokeBARequest(this.beforeManagers, base, callback); | ||
} | ||
exports.invokeBeforeRequest = invokeBeforeRequest; | ||
function invokeAfterRequest(base, callback) { | ||
this.invokeBARequest(this.afterManagers, base, callback); | ||
} | ||
exports.invokeAfterRequest = invokeAfterRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { MethodCallArgs, WebDAVRequest } from '../WebDAVRequest'; | ||
export declare function beforeRequest(manager: WebDAVRequest): void; | ||
export declare function afterRequest(manager: WebDAVRequest): void; | ||
export declare function invokeBARequest(collection: WebDAVRequest[], base: MethodCallArgs, callback: any): void; | ||
export declare function invokeBeforeRequest(base: MethodCallArgs, callback: any): void; | ||
export declare function invokeAfterRequest(base: MethodCallArgs, callback: any): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function beforeRequest(manager) { | ||
this.beforeManagers.push(manager); | ||
} | ||
exports.beforeRequest = beforeRequest; | ||
function afterRequest(manager) { | ||
this.afterManagers.push(manager); | ||
} | ||
exports.afterRequest = afterRequest; | ||
function invokeBARequest(collection, base, callback) { | ||
function callCallback() { | ||
if (callback) | ||
process.nextTick(callback); | ||
} | ||
if (collection.length === 0) { | ||
callCallback(); | ||
return; | ||
} | ||
base.callback = next; | ||
var nb = collection.length + 1; | ||
function next() { | ||
--nb; | ||
if (nb === 0) { | ||
callCallback(); | ||
} | ||
else | ||
process.nextTick(function () { return collection[collection.length - nb](base, next); }); | ||
} | ||
next(); | ||
} | ||
exports.invokeBARequest = invokeBARequest; | ||
function invokeBeforeRequest(base, callback) { | ||
this.invokeBARequest(this.beforeManagers, base, callback); | ||
} | ||
exports.invokeBeforeRequest = invokeBeforeRequest; | ||
function invokeAfterRequest(base, callback) { | ||
this.invokeBARequest(this.afterManagers, base, callback); | ||
} | ||
exports.invokeAfterRequest = invokeAfterRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/// <reference types="node" /> | ||
import { MethodCallArgs, WebDAVRequest } from './WebDAVRequest'; | ||
import { WebDAVServerOptions } from './WebDAVServerOptions'; | ||
import { SerializedObject } from '../manager/ISerializer'; | ||
import { IResource, ReturnCallback } from '../resource/IResource'; | ||
import { HTTPAuthentication } from '../user/authentication/HTTPAuthentication'; | ||
import { IPrivilegeManager } from '../user/privilege/IPrivilegeManager'; | ||
import { FSManager, FSPath } from '../manager/FSManager'; | ||
import { IUserManager } from '../user/IUserManager'; | ||
import * as http from 'http'; | ||
export { WebDAVServerOptions } from './WebDAVServerOptions'; | ||
export declare type WebDAVServerStartCallback = (server?: http.Server) => void; | ||
export interface IResourceTreeNode { | ||
r?: IResource; | ||
resource?: IResource; | ||
c?: ResourceTreeNode[]; | ||
children?: ResourceTreeNode[]; | ||
} | ||
export declare type ResourceTreeNode = IResourceTreeNode | IResource | IResourceTreeNode[] | IResource[]; | ||
export declare class WebDAVServer { | ||
httpAuthentication: HTTPAuthentication; | ||
privilegeManager: IPrivilegeManager; | ||
rootResource: IResource; | ||
userManager: IUserManager; | ||
options: WebDAVServerOptions; | ||
methods: object; | ||
protected beforeManagers: WebDAVRequest[]; | ||
protected afterManagers: WebDAVRequest[]; | ||
protected unknownMethod: WebDAVRequest; | ||
protected server: http.Server; | ||
constructor(options?: WebDAVServerOptions); | ||
getResourceFromPath(path: FSPath | string[] | string, callback: ReturnCallback<IResource>): any; | ||
getResourceFromPath(path: FSPath | string[] | string, rootResource: IResource, callback: ReturnCallback<IResource>): any; | ||
addResourceTree(resoureceTree: ResourceTreeNode, callback: (e: Error) => void): any; | ||
addResourceTree(rootResource: IResource, resoureceTree: ResourceTreeNode, callback: (e: Error) => void): any; | ||
onUnknownMethod(unknownMethod: WebDAVRequest): void; | ||
start(port: number): any; | ||
start(callback: WebDAVServerStartCallback): any; | ||
start(port: number, callback: WebDAVServerStartCallback): any; | ||
stop(callback: () => void): void; | ||
load(obj: SerializedObject, managers: FSManager[], callback: (error: Error) => void): void; | ||
save(callback: (error: Error, obj: any) => void): void; | ||
method(name: string, manager: WebDAVRequest): void; | ||
beforeRequest(manager: WebDAVRequest): void; | ||
afterRequest(manager: WebDAVRequest): void; | ||
protected normalizeMethodName(method: string): string; | ||
protected invokeBARequest(collection: WebDAVRequest[], base: MethodCallArgs, callback: any): void; | ||
protected invokeBeforeRequest(base: MethodCallArgs, callback: any): void; | ||
protected invokeAfterRequest(base: MethodCallArgs, callback: any): void; | ||
} |
Oops, something went wrong.