package com.gingersoft.gsa.cloud.common.utils.xlog;

import com.elvishew.xlog.printer.file.backup.BackupStrategy;

import java.io.File;

/**
 * 作者：ELEGANT_BIN
 * 版本：1.6.0
 * 创建日期：2019-12-05
 * 修订历史：2019-12-05
 * 描述：
 */
public class MyBackupStrategy implements BackupStrategy {


    private long maxSize;

    /**
     * Constructor.
     *
     * @param maxSize the max size the file can reach
     */
    public MyBackupStrategy(long maxSize) {
        this.maxSize = maxSize;
    }

    @Override
    public boolean shouldBackup(File file) {
        return file.length() > maxSize;
    }
}
