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( 32 fileSize: number, 33 atime: number, 34 mtime: number, 35 options: string, 36 path: string, 37 optionalName: string, 38 updateIfNew: boolean, 39 compressType: number, 40 holdTimestamp: boolean, 41 functionName: string, 42 clientCwd: string, 43 reserve1: string, 44 reserve2: string 45 ) { 46 super(); 47 this._fileSize = fileSize; 48 this._atime = atime; 49 this._mtime = mtime; 50 this._options = options; 51 this._path = path; 52 this._optionalName = optionalName; 53 this._updateIfNew = updateIfNew; 54 this._compressType = compressType; 55 this._holdTimestamp = holdTimestamp; 56 this._functionName = functionName; 57 this._clientCwd = clientCwd; 58 this._reserve1 = reserve1; 59 this._reserve2 = reserve2; 60 } 61 62 get fileSize(): number { 63 return this._fileSize; 64 } 65 66 set fileSize(value: number) { 67 this._fileSize = value; 68 } 69 70 get atime(): number { 71 return this._atime; 72 } 73 74 set atime(value: number) { 75 this._atime = value; 76 } 77 78 get mtime(): number { 79 return this._mtime; 80 } 81 82 set mtime(value: number) { 83 this._mtime = value; 84 } 85 86 get options(): string { 87 return this._options; 88 } 89 90 set options(value: string) { 91 this._options = value; 92 } 93 94 get path(): string { 95 return this._path; 96 } 97 98 set path(value: string) { 99 this._path = value; 100 } 101 102 get optionalName(): string { 103 return this._optionalName; 104 } 105 106 set optionalName(value: string) { 107 this._optionalName = value; 108 } 109 110 get updateIfNew(): boolean { 111 return this._updateIfNew; 112 } 113 114 set updateIfNew(value: boolean) { 115 this._updateIfNew = value; 116 } 117 118 get compressType(): number { 119 return this._compressType; 120 } 121 122 set compressType(value: number) { 123 this._compressType = value; 124 } 125 126 get holdTimestamp(): boolean { 127 return this._holdTimestamp; 128 } 129 130 set holdTimestamp(value: boolean) { 131 this._holdTimestamp = value; 132 } 133 134 get functionName(): string { 135 return this._functionName; 136 } 137 138 set functionName(value: string) { 139 this._functionName = value; 140 } 141 142 get clientCwd(): string { 143 return this._clientCwd; 144 } 145 146 set clientCwd(value: string) { 147 this._clientCwd = value; 148 } 149 150 get reserve1(): string { 151 return this._reserve1; 152 } 153 154 set reserve1(value: string) { 155 this._reserve1 = value; 156 } 157 158 get reserve2(): string { 159 return this._reserve2; 160 } 161 162 set reserve2(value: string) { 163 this._reserve2 = value; 164 } 165 166 toString(): string { 167 return ( 168 'fileSize: ' + 169 this._fileSize + 170 ' atime: ' + 171 this._atime + 172 ' mtime: ' + 173 this._mtime + 174 ' options: ' + 175 this._options + 176 ' path: ' + 177 this._path + 178 ' optionalName: ' + 179 this._optionalName + 180 ' updateIfNew: ' + 181 this._updateIfNew + 182 ' compressType: ' + 183 this._compressType + 184 ' holdTimestamp: ' + 185 this._holdTimestamp + 186 ' functionName: ' + 187 this._functionName + 188 ' clientCwd: ' + 189 this._clientCwd + 190 ' reserve1: ' + 191 this._reserve1 + 192 ' reserve2: ' + 193 this._reserve2 194 ); 195 } 196} 197 198enum CompressType { 199 COMPRESS_NONE, 200 COMPRESS_LZ4, 201 COMPRESS_LZ77, 202 COMPRESS_LZMA, 203 COMPRESS_BROTLI, 204} 205