!518 代码格式调整

Merge pull request !518 from 胖子的梦/bugfix/code_format
This commit is contained in:
openharmony_ci 2023-08-16 09:23:49 +00:00 committed by Gitee
commit d2ce217240
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -40,6 +40,7 @@ const CREATE_EVENT = 0;
const DELETE_EVENT = 1;
const UPDATE_EVENT = 2;
const CONVERT_TO_HEX = 16;
const MOVE_MODLE_CODE = 3;
// ['IN_ACCESS', 0x00000001],
// ['IN_MODIFY', 0x00000002],
@ -355,24 +356,24 @@ export default class FileExtAbility extends Extension {
let statOld = fs.statSync(oldPath);
if (!statOld) {
return {
uri: '',
code: E_GETRESULT,
}
return {
uri: '',
code: E_GETRESULT,
}
}
// isDir
if (statOld.isDirectory()) {
fs.moveDirSync(oldPath, getPath(targetParentUri), 3);
return {
uri: newFileUri,
code: ERR_OK,
};
fs.moveDirSync(oldPath, getPath(targetParentUri), MOVE_MODLE_CODE);
return {
uri: newFileUri,
code: ERR_OK,
};
}
// when targetFile is exist, delete it
let isAccessNewPath = fs.accessSync(newPath);
if (isAccessNewPath) {
fs.unlinkSync(newPath);
fs.unlinkSync(newPath);
}
fs.moveFileSync(oldPath, newPath, 0);
@ -575,7 +576,7 @@ export default class FileExtAbility extends Extension {
/*
* selectFileRelativePath formate /storage/Users/currentUser/filename
*/
getFileInfoFromRelativePath(selectFileRelativePath) {
getFileInfoFromRelativePath(selectFileRelativePath): {fileInfo:object, code:number} {
let fileInfo = {};
if (!this.checkRelativePath(selectFileRelativePath)) {
return {