class PropertiesUtils {

    public static File fileFromTmpFolder(String subpath) {
        try {
            String canonicalPath = new File(VitamConfiguration.getVitamTmpFolder()).getCanonicalPath();
            File file = new File(VitamConfiguration.getVitamTmpFolder(), subpath);
            String fileCanonicalPath = file.getCanonicalPath();

            if (!fileCanonicalPath.startsWith(canonicalPath)) {
                throw new VitamRuntimeException(String.format("invalid path with subpath: %s", subpath));
            }

            return file;
        } catch (IOException e) {
            throw new VitamRuntimeException(e);
        }

    }

    private  PropertiesUtils();

}