package cn.com.qmth.examcloud.core.questions.base;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;

public class IoUtils {
    private static final Logger log = LoggerFactory.getLogger(IoUtils.class);

    public static boolean createFile(File file) {
        try {
            return file.createNewFile();
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    public static boolean removeFile(File file) {
        try {
            return file.delete();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

}