Package ru.petrsu.akolosov.flowbrook

Examples of ru.petrsu.akolosov.flowbrook.FlowSourceSet


        Calendar cal = Calendar.getInstance();
        FlowSource firstSource = null;
        FlowSource lastSource = null;

        for (String path : args) {
            FlowSourceSet sourceSet = FlowTools.getSourceFromDir(new File(path), true);
            if (lastSource != null)
                sourceSet.addFlowSource(lastSource);

            List<FlowSource> sources = sourceSet.getEffectiveSources();

            for (int i = 0; i < sources.size() - 1; i++) {
                FlowSource s1 = sources.get(i);
                FlowSource s2 = lastSource = sources.get(i + 1);
View Full Code Here


        } catch (FileNotFoundException ex) {
            Logger.getLogger(FlowStats.class.getName()).log(Level.SEVERE, null, ex);
        }

        for (String path : args) {
            FlowSourceSet sourceSet = FlowTools.getSourceFromDir(new File(path), true);

            FlowSourceSetHandler fsHandler = new ConcurrentFlowSourceSetHandler(sourceSet, statsRules);

            cal.setTime(sourceSet.getFirstFlowTime());
            cal.set(Calendar.DAY_OF_MONTH, 1);
            cal.set(Calendar.HOUR_OF_DAY, 0);
            cal.set(Calendar.MINUTE, 0);
            cal.set(Calendar.SECOND, 0);
            cal.set(Calendar.MILLISECOND, 0);
View Full Code Here

            throw new IllegalArgumentException("Argument must be a directory.");
        }

        logger.log(Level.INFO, "Loading flow-tools files from " + startDir.getAbsolutePath());

        FlowSourceSet ftDir = new FlowSourceSet();

        Deque<File> dirStack = new LinkedList<File>();
        dirStack.add(startDir);
        int i = 0;

        do {
            File curDir = dirStack.removeFirst();
            logger.log(Level.FINER, "Entering directory " + curDir.getAbsolutePath());

            for (File f : curDir.listFiles()) {
                if (f.isDirectory() && recursive) {
                    dirStack.addFirst(f);
                    continue;
                } else if (!f.isFile()) {
                    logger.log(Level.INFO, "Skipping " + f.getAbsolutePath() + ": not a file.");
                    continue;
                }

                try {
                    ftDir.addFlowSource(getSourceFromFile(f));
                    i++;
                    logger.log(Level.FINE, "File " + f.getAbsolutePath() + " loaded.");
                } catch (FileNotFoundException ex) {
                    logger.log(Level.SEVERE, null, ex);
                } catch (IOException ex) {
View Full Code Here

TOP

Related Classes of ru.petrsu.akolosov.flowbrook.FlowSourceSet

Copyright © 2018 www.massapicom. 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.