Package com.google.code.ftspc.lector

Source Code of com.google.code.ftspc.lector.CheckDateForPath

package com.google.code.ftspc.lector;

import com.google.code.ftspc.lector.ini_and_vars.Vars;
import java.io.File;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
*
* @author Arthur Khusnutdinov
*/
public class CheckDateForPath implements Job {

    /**
     * The method of the timer.
     * @param context
     * @throws JobExecutionException
     */
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        Date date = new Date();
        Format yearFormat = new SimpleDateFormat("yyyy");
        Format monthFormat = new SimpleDateFormat("MM");
        Format dayFormat = new SimpleDateFormat("dd");
        String pathToDayDir = Vars.Lector_Repository + "/" + yearFormat.format(date)
                + "/" + monthFormat.format(date) + "/" + dayFormat.format(date);
        File pathToDayDirFile = new File(pathToDayDir);
        if (!pathToDayDirFile.exists()) {
            pathToDayDirFile.mkdirs();
        }
        Vars.pathToDayDir = pathToDayDir;
    }
}
TOP

Related Classes of com.google.code.ftspc.lector.CheckDateForPath

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.