1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16export class TransferConfig extends Object{ 17 private _fileSize: number = -1; // uint64_t 18 private _atime: number = -1; // uint64_t ns 19 private _mtime: number = -1; // uint64_t ns 20 private _options: string = ''; // string 21 private _path: string = ''; 22 private _optionalName: string = ''; 23 private _updateIfNew: boolean = false; //bool 24 private _compressType: number = CompressType.COMPRESS_NONE; // uint8_t 25 private _holdTimestamp: boolean = false; //bool 26 private _functionName: string = ''; 27 private _clientCwd: string = ''; 28 private _reserve1: string = ''; 29 private _reserve2: string = ''; 30 31 constructor(fileSize: number, atime: number, mtime: number, options: string, path: string, 32 optionalName: string, updateIfNew: boolean, compressType: number, holdTimestamp: boolean, 33 functionName: string, clientCwd: string, reserve1: string, reserve2: string) { 34 super(); 35 this._fileSize = fileSize; 36 this._atime = atime; 37 this._mtime = mtime; 38 this._options = options; 39 this._path = path; 40 this._optionalName = optionalName; 41 this._updateIfNew = updateIfNew; 42 this._compressType = compressType; 43 this._holdTimestamp = holdTimestamp; 44 this._functionName = functionName; 45 this._clientCwd = clientCwd; 46 this._reserve1 = reserve1; 47 this._reserve2 = reserve2; 48 } 49 50 51 get fileSize(): number { 52 return this._fileSize; 53 } 54 55 set fileSize(value: number) { 56 this._fileSize = value; 57 } 58 59 get atime(): number { 60 return this._atime; 61 } 62 63 set atime(value: number) { 64 this._atime = value; 65 } 66 67 get mtime(): number { 68 return this._mtime; 69 } 70 71 set mtime(value: number) { 72 this._mtime = value; 73 } 74 75 get options(): string { 76 return this._options; 77 } 78 79 set options(value: string) { 80 this._options = value; 81 } 82 83 get path(): string { 84 return this._path; 85 } 86 87 set path(value: string) { 88 this._path = value; 89 } 90 91 get optionalName(): string { 92 return this._optionalName; 93 } 94 95 set optionalName(value: string) { 96 this._optionalName = value; 97 } 98 99 get updateIfNew(): boolean { 100 return this._updateIfNew; 101 } 102 103 set updateIfNew(value: boolean) { 104 this._updateIfNew = value; 105 } 106 107 get compressType(): number { 108 return this._compressType; 109 } 110 111 set compressType(value: number) { 112 this._compressType = value; 113 } 114 115 get holdTimestamp(): boolean { 116 return this._holdTimestamp; 117 } 118 119 set holdTimestamp(value: boolean) { 120 this._holdTimestamp = value; 121 } 122 123 get functionName(): string { 124 return this._functionName; 125 } 126 127 set functionName(value: string) { 128 this._functionName = value; 129 } 130 131 get clientCwd(): string { 132 return this._clientCwd; 133 } 134 135 set clientCwd(value: string) { 136 this._clientCwd = value; 137 } 138 139 get reserve1(): string { 140 return this._reserve1; 141 } 142 143 set reserve1(value: string) { 144 this._reserve1 = value; 145 } 146 147 get reserve2(): string { 148 return this._reserve2; 149 } 150 151 set reserve2(value: string) { 152 this._reserve2 = value; 153 } 154 155 toString(): string { 156 return "fileSize: " + this._fileSize 157 + " atime: " + this._atime 158 + " mtime: " + this._mtime 159 + " options: " + this._options 160 + " path: " + this._path 161 + " optionalName: " + this._optionalName 162 + " updateIfNew: " + this._updateIfNew 163 + " compressType: " + this._compressType 164 + " holdTimestamp: " + this._holdTimestamp 165 + " functionName: " + this._functionName 166 + " clientCwd: " + this._clientCwd 167 + " reserve1: " + this._reserve1 168 + " reserve2: " + this._reserve2; 169 } 170} 171 172enum CompressType { COMPRESS_NONE, COMPRESS_LZ4, COMPRESS_LZ77, COMPRESS_LZMA, COMPRESS_BROTLI }; 173