From cf140a581013eb77cbefe33a94a21690dfc402b5 Mon Sep 17 00:00:00 2001 From: kjs Date: Fri, 5 Sep 2025 15:18:29 +0900 Subject: [PATCH] =?UTF-8?q?=ED=83=80=EC=9E=85=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend-node/src/utils/fileSystemManager.ts | 46 --------------------- 1 file changed, 46 deletions(-) diff --git a/backend-node/src/utils/fileSystemManager.ts b/backend-node/src/utils/fileSystemManager.ts index a0b343d4..b0053656 100644 --- a/backend-node/src/utils/fileSystemManager.ts +++ b/backend-node/src/utils/fileSystemManager.ts @@ -132,52 +132,6 @@ export class FileSystemManager { return sharedPath; } - /** - * 회사별 폴더 구조에서 파일 찾기 - * @param companyCode 회사 코드 - * @param serverFilename 서버 파일명 - * @returns 찾은 파일의 전체 경로 또는 null - */ - static findFileInCompanyFolders( - companyCode: string, - serverFilename: string - ): string | null { - try { - const companyBasePath = path.join( - this.BASE_UPLOAD_PATH, - `company_${companyCode}` - ); - - if (!fs.existsSync(companyBasePath)) { - return null; - } - - // 회사 폴더 내의 모든 하위 폴더를 재귀적으로 검색 - const findFileRecursively = (dirPath: string): string | null => { - const items = fs.readdirSync(dirPath); - - for (const item of items) { - const itemPath = path.join(dirPath, item); - const stats = fs.statSync(itemPath); - - if (stats.isFile() && item === serverFilename) { - return itemPath; - } else if (stats.isDirectory()) { - const found = findFileRecursively(itemPath); - if (found) return found; - } - } - - return null; - }; - - return findFileRecursively(companyBasePath); - } catch (error) { - logger.error(`파일 검색 실패: ${companyCode}/${serverFilename}`, error); - return null; - } - } - /** * 회사별 디스크 사용량 조회 * @param companyCode 회사 코드