3c09a54735f829be28464caa1917e4998f14aded
[sdc.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * Modifications Copyright (c) 2019 Samsung
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.openecomp.sdc.asdctool.impl.validator.config;
26
27 import java.util.function.Supplier;
28
29 public class ValidationConfigManager {
30
31     private static final String CSV_FILE_PREFIX = "/csvSummary_";
32     private static final String CSV_EXT = ".csv";
33     public static final String DEFAULT_CSV_PATH = "summary.csv";
34
35     private static String outputFullFilePath;
36     private static String outputFilePath;
37
38     private ValidationConfigManager() {
39     }
40
41     public static String csvReportFilePath(String outputPath, Supplier<Long> getTime) {
42         return outputPath + CSV_FILE_PREFIX + getTime.get() + CSV_EXT;
43     }
44
45     public static String getOutputFullFilePath() {
46         return outputFullFilePath;
47     }
48
49     public static String getOutputFilePath() {
50         return outputFilePath;
51     }
52
53     public static void setOutputFullFilePath(String outputPath) {
54         ValidationConfigManager.outputFilePath = outputPath;
55         ValidationConfigManager.outputFullFilePath = outputPath + "/reportOutput.txt";
56     }
57 }