Package de.grey.ownsync.action

Examples of de.grey.ownsync.action.FileAction


        OwnSyncStarter.logger.config("Evaluating synchronisation actions");
        long start = System.currentTimeMillis();
       
        String fa = folderA.getAbsolutePath();
        String fb = folderB.getAbsolutePath();
        FileAction action;
        String key;
        for (int i = 0; i < allSubPaths.size(); i++)
        {
            key = (String) allSubPaths.get(i);
            action = calculateAction(fa+key, fb+key);
            if (action != null)
            {
                allFileActions.add(action);
                if (action instanceof NewAction)
                {
                    if (action.isDirectoryAction())
                        countNewDirAction++;
                    else
                        countNewFileAction++;
                }
                else if (action instanceof DeleteAction)
                {
                    if (action.isDirectoryAction())
                        countDeleteDirAction++;
                    else
                        countDeleteFileAction++;
                }
                else if (action instanceof CopyAction)
                {
                    if (action.isDirectoryAction())
                        countCopyDirAction++;
                    else
                        countCopyFileAction++;
                }
            }
View Full Code Here


    public void executeActions() throws Exception
    {
        OwnSyncStarter.logger.config("Executing " + allFileActions.size() + " synchronisation actions");
        long start = System.currentTimeMillis();
       
        FileAction action;
        try
        {
            for (int i = 0; i < allFileActions.size(); i++)
            {
                action = (FileAction) allFileActions.get(i);

                OwnSyncStarter.logger.fine(action.toString());
                if (!action.executeAction())
                {
                    OwnSyncStarter.logger.config("Executing action " + action + " failed, sync will be stopped");
                    break;
                }
            }
View Full Code Here

        OwnSyncConfiguration.logger.config("Evaluating synchronisation actions");
        long start = System.currentTimeMillis();
       
        String fa = folderStateA.getFolderLocation().getAbsolutePath();
        String fb = folderStateB.getFolderLocation().getAbsolutePath();
        FileAction action;
        String key;
        for (int i = 0; i < allSubPaths.size(); i++)
        {
            key = (String) allSubPaths.get(i);
            action = calculateAction(fa+key, fb+key);
            if (action != null)
            {
                allFileActions.add(action);
                if (action instanceof NewAction)
                {
                    if (action.isDirectoryAction())
                        countNewDirAction++;
                    else
                        countNewFileAction++;
                }
                else if (action instanceof DeleteAction)
                {
                    if (action.isDirectoryAction())
                        countDeleteDirAction++;
                    else
                        countDeleteFileAction++;
                }
                else if (action instanceof CopyAction)
                {
                    if (action.isDirectoryAction())
                        countCopyDirAction++;
                    else
                        countCopyFileAction++;
                }
            }
View Full Code Here

    public void executeActions() throws Exception
    {
        OwnSyncConfiguration.logger.config("Executing " + allFileActions.size() + " synchronisation actions");
        long start = System.currentTimeMillis();
       
        FileAction action;
        try
        {
            for (int i = 0; i < allFileActions.size(); i++)
            {
                action = (FileAction) allFileActions.get(i);

                OwnSyncConfiguration.logger.fine(action.toString());
                if (!action.executeAction())
                {
                    OwnSyncConfiguration.logger.config("Executing action " + action + " failed, sync will be stopped");
                    break;
                }
            }
View Full Code Here

        OwnSyncStatus.setMessage("Calculating synchronisation actions");
        long start = System.currentTimeMillis();
       
        String fa = FileUtils.getAbsolutePath(folderStateA.getFolderLocation());
        String fb = FileUtils.getAbsolutePath(folderStateB.getFolderLocation());
        FileAction action;
        String key;
        for (int i = 0; i < allSubPaths.size(); i++)
        {
            key = (String) allSubPaths.get(i);
            action = calculateAction(fa+key, fb+key);
View Full Code Here

        OwnSyncStatus.setMessage("Executing " + allFileActions.size() + " synchronisation actions");
        OwnSyncStatus.setMessage("---------------------------------------------------------");
        long start = System.currentTimeMillis();
       
        long actionStart = 0;
        FileAction action;
        try
        {
            for (int i = 0; i < allFileActions.size(); i++)
            {
                action = (FileAction) allFileActions.get(i);

                OwnSyncStatus.setMessage(action.toString());
                actionStart = System.currentTimeMillis();
                if (!action.executeAction())
                {
                    OwnSyncStatus.appendToMessage(" failed after "+DataFormatter.getTimeString(System.currentTimeMillis() - actionStart));
                    OwnSyncStatus.setMessage("ERROR Executing action " + action + " failed, please retry later");
                    action.incrementActionCount(result);
                }
                else
                {
                    OwnSyncStatus.appendToMessage(" took "+DataFormatter.getTimeString(System.currentTimeMillis() - actionStart));
                    action.incrementActionCount(result);
                }
            }
        }
        catch (Exception e)
        {
View Full Code Here

TOP

Related Classes of de.grey.ownsync.action.FileAction

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.