Package ca.pgon.saviorlib.Exceptions

Examples of ca.pgon.saviorlib.Exceptions.EngineException


     * Will also check if the filesystems are accessible
     * You can call this as the first function of start()
     */
    protected void checkValidEngine() {
        if (sourceFS == null) {
            throw new EngineException("The source file system is not defined");
        }
       
        if (destinationFS == null) {
            throw new EngineException("The destination file system is not defined");
        }
       
        try {
            sourceFS.checkIfValid();
        } catch (FileSystemException ex) {
            throw new EngineException("The source file system is not accessible", ex);
        }
       
        try {
            destinationFS.checkIfValid();
        } catch (FileSystemException ex) {
            throw new EngineException("The destination file system is not accessible", ex);
        }
       
        if (ignoreFiles == null) {
            ignoreFiles = new ArrayList<String>();
        }
View Full Code Here


     * @param destination
     * @return True if the file should be updated
     */
    protected boolean checkIfModified(FileEntry source, FileEntry destination) {
        if (checkMods == null || checkMods.isEmpty()) {
            throw new EngineException("There are no checkMods defined");
        }
       
        for (CheckMod next: checkMods) {
            if (next.needUpdate(source, destination)) return true;
        }
View Full Code Here

           
            while ( (len = readOnlyAvailable(bin, b, 1024)) != -1) {
                if (requestStop.get()) {
                    bin.close();
                    out.close();
                    throw new EngineException("User requested stop");
                }
                if (requestPause.get()) {
                    requestPause.set(false);
                    try {bin.close();} catch (FileSystemException e) {}
                    try {out.close();} catch (FileSystemException e) {}
                    throw new EnginePauseException(count);
                }
                callProgressEvent(destination, count);
                out.write(b, 0, len);
                count += len;
            }
           
            bin.close();
            out.close();
        } catch (IOException ex) {
            throw new EngineException("Error copying the stream", ex);
        }
    }
View Full Code Here

        }
    }
   
    private void stopIfNeeded() {
        if (requestStop.get()) {
            throw new EngineException("User requested stop");
        }
    }
View Full Code Here

     * Will also check if the filesystems are accessible
     * You can call this as the first function of start()
     */
    protected void checkValidEngine() {
        if (sourceFS == null) {
            throw new EngineException("The source file system is not defined");
        }
       
        if (destinationFS == null) {
            throw new EngineException("The destination file system is not defined");
        }
       
        try {
            sourceFS.checkIfValid();
        } catch (FileSystemException ex) {
            throw new EngineException("The source file system is not accessible", ex);
        }
       
        try {
            destinationFS.checkIfValid();
        } catch (FileSystemException ex) {
            throw new EngineException("The destination file system is not accessible", ex);
        }
       
        if (ignoreFiles == null) {
            ignoreFiles = new ArrayList<String>();
        }
View Full Code Here

     * @param destination
     * @return True if the file should be updated
     */
    protected boolean checkIfModified(FileEntry source, FileEntry destination) {
        if (checkMods == null || checkMods.isEmpty()) {
            throw new EngineException("There are no checkMods defined");
        }
       
        for (CheckMod next: checkMods) {
            if (next.needUpdate(source, destination)) return true;
        }
View Full Code Here

           
            while ( (len = readOnlyAvailable(bin, b, 1024)) != -1) {
                if (requestStop.get()) {
                    bin.close();
                    out.close();
                    throw new EngineException("User requested stop");
                }
                if (requestPause.get()) {
                    requestPause.set(false);
                    try {bin.close();} catch (FileSystemException e) {}
                    try {out.close();} catch (FileSystemException e) {}
                    throw new EnginePauseException(count);
                }
                callProgressEvent(destination, count);
                out.write(b, 0, len);
                count += len;
            }
           
            bin.close();
            out.close();
        } catch (IOException ex) {
            throw new EngineException("Error copying the stream", ex);
        }
    }
View Full Code Here

        }
    }
   
    private void stopIfNeeded() {
        if (requestStop.get()) {
            throw new EngineException("User requested stop");
        }
    }
View Full Code Here

TOP

Related Classes of ca.pgon.saviorlib.Exceptions.EngineException

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.