package egovframework.com.its.web.server.util;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;

@Slf4j
@Getter
public class CommonPath {
    private String filePath;
    private String uploadPath;

    public CommonPath(@Value("${attatch_path}") String filePath, @Value("${upload_path}") String uploadPath) {
        this.filePath = filePath;
        this.uploadPath = uploadPath;
    }


    public String getFilePath() {
        final String OS = System.getProperty("os.name").toLowerCase();
        if (OS.contains("win")) {
            return this.getFilePath();
        }
        return "home/web-data/attatchFile";
    }

    public String getImageUploadPath() {
        final String OS = System.getProperty("os.name").toLowerCase();
        if (OS.contains("win")) {
            return this.getUploadPath();
        }
        return "home/web-data/upload";
    }
}
