Examples of OwnSyncException


Examples of de.grey.ownsync.exception.OwnSyncException

                props.put(WastbasketFolderB, "/Sample/Folder_B_Trashbox");
                props.put(KeepLastFileVersionB, "true");

                props.storeToXML(new FileOutputStream(configFile), "Sample");

                OwnSyncException ose = new OwnSyncException("Config file does not exist, is created and initialized!");
                logger.throwing("OwnSyncStarter", "loadConfig(" + config + ")", ose);
                throw ose;
            }
            props = new Properties();
            props.loadFromXML(new FileInputStream(configFile));

            createLogger(props);
           
            folderAConfiguration = new FolderConfiguration(SyncFolderA, SyncFolderStateA, WastbasketFolderA, KeepLastFileVersionA, SyncExclusionPatternsA, props);
           
            folderBConfiguration = new FolderConfiguration(SyncFolderB, SyncFolderStateB, WastbasketFolderB, KeepLastFileVersionB, SyncExclusionPatternsB, props);

            logger.finest("read config file " + config);
        }
        catch (IOException e)
        {
            logger.throwing("OwnSyncStarter", "loadConfig", e);
            e.printStackTrace();
            throw new OwnSyncException(e);
        }
    }
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

            file.createNewFile();
        }

        if (!file.isFile())
        {
            OwnSyncException ose = new OwnSyncException("File " + file.getAbsolutePath() + " for property " + propertyName + " is not a file! \n EXITING!");
            OwnSyncConfiguration.logger.throwing("OwnSyncStarter", "getFile(" + propertyName + ")", ose);
            throw ose;
        }
        if (!file.canWrite())
        {
            OwnSyncException ose = new OwnSyncException("File " + file.getAbsolutePath() + " for property " + propertyName + " is not writeable! \n EXITING!");
            OwnSyncConfiguration.logger.throwing("OwnSyncStarter", "getFile(" + propertyName + ")", ose);
            throw ose;
        }
        return file;
    }
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

        {
            if (create)
                FileUtils.forceMkdir(folder);
            else
            {
                OwnSyncException ose = new OwnSyncException("Folder " + folder.getAbsolutePath() + " for property " + propertyName + " not found! \n EXITING!");
                OwnSyncConfiguration.logger.throwing("OwnSyncStarter", "getFolder(" + propertyName + ")", ose);
                throw ose;
            }
        }
        if (!folder.isDirectory())
        {
            OwnSyncException ose = new OwnSyncException("Folder " + folder.getAbsolutePath() + " for property " + propertyName + " is not a directory! \n EXITING!");
            OwnSyncConfiguration.logger.throwing("OwnSyncStarter", "getFolder(" + propertyName + ")", ose);
            throw ose;
        }

        return folder;
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

            file.createFile();
        }

        if (FileUtils.isFolder(file))
        {
            OwnSyncException ose = new OwnSyncException("File " + FileUtils.getAbsolutePath(file) + " for property " + propertyName + " is not a file! \n EXITING!");
            OwnSyncStatus.throwingMessage("OwnSyncStarter", "getFile(" + propertyName + ")", ose);
            throw ose;
        }
        if (!file.isWriteable())
        {
            OwnSyncException ose = new OwnSyncException("File " + FileUtils.getAbsolutePath(file) + " for property " + propertyName + " is not writeable! \n EXITING!");
            OwnSyncStatus.throwingMessage("OwnSyncStarter", "getFile(" + propertyName + ")", ose);
            throw ose;
        }
        return file;
    }
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

        {
            if (create)
                folder.createFolder();
            else
            {
                OwnSyncException ose = new OwnSyncException("Folder " + FileUtils.getAbsolutePath(folder) + " for property " + propertyName + " not found! \n EXITING!");
                OwnSyncStatus.throwingMessage("OwnSyncStarter", "getFolder(" + propertyName + ")", ose);
                throw ose;
            }
        }
        if (FileUtils.isFile(folder))
        {
            OwnSyncException ose = new OwnSyncException("Folder " + FileUtils.getAbsolutePath(folder) + " for property " + propertyName + " is not a directory! \n EXITING!");
            OwnSyncStatus.throwingMessage("OwnSyncStarter", "getFolder(" + propertyName + ")", ose);
            throw ose;
        }

        return folder;
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

        String folderLocationFullPath = folderLocation.getAbsolutePath();
        String fullPath = file.getAbsolutePath();

        if (!fullPath.startsWith(folderLocationFullPath))
        {
            OwnSyncException ose = new OwnSyncException("fullPath ("+fullPath+") does not start with folderLocationFullPath ("+folderLocationFullPath+")");
            OwnSyncStarter.logger.throwing("FileState", "FileState("+file.getAbsolutePath()+", "+folderLocation.getAbsolutePath()+", "+syncWastbasket+")", ose);
            throw ose;
        }
       
        if (file.isFile())
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

        String folderLocationFullPath = folderLocation.getAbsolutePath();
        String fullPath = file.getAbsolutePath();

        if (!fullPath.startsWith(folderLocationFullPath))
        {
            OwnSyncException ose = new OwnSyncException("fullPath ("+fullPath+") does not start with folderLocationFullPath ("+folderLocationFullPath+")");
            OwnSyncConfiguration.logger.throwing("FileState", "FileState("+file.getAbsolutePath()+", "+folderLocation.getAbsolutePath()+", "+syncWastbasket+")", ose);
            throw ose;
        }
       
        if (file.isFile())
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

        // fileStateA != null and fileStateB != null
       
        if ((fileStateA.isDirectory() && !fileStateB.isDirectory()) ||
            (!fileStateA.isDirectory() && fileStateB.isDirectory()))
        {
            OwnSyncException ose = new OwnSyncException("Comparing " + fileStateA.getFile().getAbsolutePath() + " with " + fileStateB.getFile().getAbsolutePath() + " failed, could not compare file with directory!\nEXITING!");
            OwnSyncStarter.logger.throwing("FolderSynchronizer", "calculateAction", ose);
            throw ose;
        }
       
        switch (fileStateA.getModifications())
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

        // fileStateA != null and fileStateB != null
       
        if ((fileStateA.isDirectory() && !fileStateB.isDirectory()) ||
            (!fileStateA.isDirectory() && fileStateB.isDirectory()))
        {
            OwnSyncException ose = new OwnSyncException("Comparing " + fileStateA.getFile().getAbsolutePath() + " with " + fileStateB.getFile().getAbsolutePath() + " failed, could not compare file with directory!\nEXITING!");
            OwnSyncConfiguration.logger.throwing("FolderSynchronizer", "calculateAction", ose);
            throw ose;
        }
       
        if (folderStateA.getSyncExclusionPatterns().matches(fileStateA.getFile()) ||
View Full Code Here

Examples of de.grey.ownsync.exception.OwnSyncException

        String folderLocationFullPath = FileUtils.getAbsolutePath(folderLocation);
        String fullPath = FileUtils.getAbsolutePath(file);

        if (!fullPath.startsWith(folderLocationFullPath))
        {
            OwnSyncException ose = new OwnSyncException("fullPath ("+fullPath+") does not start with folderLocationFullPath ("+folderLocationFullPath+")");
            OwnSyncStatus.throwingMessage("FileState", "FileState("+FileUtils.getAbsolutePath(file)+", "+FileUtils.getAbsolutePath(folderLocation)+", "+syncWastbasket+")", ose);
            throw ose;
        }
       
        if (FileUtils.isFile(file))
View Full Code Here
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.