소스 검색

remove getMetaJson

mizozobu 6 년 전
부모
커밋
98ee0879b2
1개의 변경된 파일1개의 추가작업 그리고 30개의 파일을 삭제
  1. 1 30
      src/server/service/export.js

+ 1 - 30
src/server/service/export.js

@@ -70,7 +70,7 @@ class ExportService {
    * @return {string} path to meta.json
    */
   async createMetaJson() {
-    const metaJson = this.getMetaJson();
+    const metaJson = path.join(this.baseDir, this.metaFileName);
     const writeStream = fs.createWriteStream(metaJson, { encoding: this.encoding });
 
     const metaData = {
@@ -253,35 +253,6 @@ class ExportService {
     return zipFile;
   }
 
-  /**
-   * get the absolute path to the zip file
-   *
-   * @memberOf ExportService
-   * @param {boolean} [validate=false] boolean to check if the file exists
-   * @return {string} absolute path to meta.json
-   */
-  getMetaJson(validate = false) {
-    const jsonFile = path.join(this.baseDir, this.metaFileName);
-
-    if (validate) {
-      try {
-        fs.accessSync(jsonFile);
-      }
-      catch (err) {
-        if (err.code === 'ENOENT') {
-          logger.error(`${jsonFile} does not exist`, err);
-        }
-        else {
-          logger.error(err);
-        }
-
-        throw err;
-      }
-    }
-
-    return jsonFile;
-  }
-
   /**
    * get a model from collection name
    *