Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNException


            nodeKind = defaultWorkspace.checkPath("", -1);
            if (nodeKind == SVNNodeKind.NONE) {
                SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                                                               "No entry at URL ''{0}''",
                                                               defaultWorkspace.getLocation().getPath());
                throw new SVNException(error);
            } else if (nodeKind == SVNNodeKind.UNKNOWN) {
                SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                                                               "Entry at URL ''{0}'' is a file while directory was expected",
                                                               defaultWorkspace.getLocation().getPath());
                throw new SVNException(error);
            } else if (nodeKind == SVNNodeKind.FILE) {
                SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                                                               "Entry at URL ''{0}'' is a file while directory was expected",
                                                               defaultWorkspace.getLocation().getPath());
                throw new SVNException(error);
            }
        } catch (SVNException e) {
            // deal with the exception
            throw new RuntimeException(e);
        }
View Full Code Here


        SVNNodeKind rootKind = repository.checkPath(root, -1);
        if (rootKind == SVNNodeKind.UNKNOWN) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                                                         "path with name '{0}' is unknown in the repository",
                                                         root);
            throw new SVNException(err);
        } else if (rootKind == SVNNodeKind.NONE) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                                                         "path with name '{0}' is missing in the repository",
                                                         root);
            throw new SVNException(err);
        } else if (rootKind == SVNNodeKind.FILE) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                                                         "path with name '{0}' is a file, you need a directory",
                                                         root);
            throw new SVNException(err);
        } else if (rootKind == SVNNodeKind.DIR) {
            ISVNEditor editor = repository.getCommitEditor(message, null, true, null);
            if (root.length() == 1 && root.charAt(0) == '/') {
                addProcess(repository, editor, root, "", child);
            } else {
View Full Code Here

            ScmAction addNodeAction = addDirectory(root, childName);
            SVNActionExecutor executor = new SVNActionExecutor(repos);
            executor.execute(addNodeAction, message);
        } else {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "Item with name '{0}' can't be created", childName);
            throw new SVNException(err);
        }
    }
View Full Code Here

            executor.execute(addFileNodeAction, message);
        } else {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                                                         "Item with name '{0}' can't be created (already exist)",
                                                         file);
            throw new SVNException(err);
        }
    }
View Full Code Here

        editor.openRoot(-1);
        try {
            action.applyAction(editor);
        } catch (Exception e) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "This error is appeared: '{0}'", e.getMessage());
            throw new SVNException(err);
        }
        editor.closeDir();
        editor.closeEdit();

    }
View Full Code Here

    }

    private void notImplementedYet(String message) throws ClientException {
        SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE,
                message == null ? "Requested SVNAdmin functionality is not yet implemented" : message);
        JavaHLObjectFactory.throwException(new SVNException(err), myDelegate);
    }
View Full Code Here

                    }
                }
            } else if (newURL == null) {
                SVNWCAccess wcAccess = createWCAccess();
                SVNAdminArea area = wcAccess.open(target, true, SVNWCAccess.INFINITE_DEPTH);
                SVNException error = null;
                try {
                    area.removeFromRevisionControl(area.getThisDirName(), true, false);
                } catch (SVNException svne) {
                    error = svne;
                }
                if (error == null || error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) {
                    try {
                        wcAccess.close();
                    } catch (SVNException svne) {
                        error = error == null ? svne : error;
                    }
                }
                if (error != null && error.getErrorMessage().getErrorCode() != SVNErrorCode.WC_LEFT_LOCAL_MOD) {
                    throw error;
                }
            } else if (externalDiff.isUpdateUnchanged || !externalDiff.compareExternals(oldURL, newURL)) {
                if (kind == SVNNodeKind.DIR) {
                    SVNFileType fileType = SVNFileType.getType(target);
View Full Code Here

    }
   
    private void deleteExternal(File external) throws SVNException {
        SVNWCAccess wcAccess = createWCAccess();
        SVNAdminArea adminArea = wcAccess.open(external, true, SVNWCAccess.INFINITE_DEPTH);
        SVNException error = null;
        try {
            adminArea.removeFromRevisionControl(adminArea.getThisDirName(), true, false);
        } catch (SVNException svne) {
            getDebugLog().logFine(SVNLogType.WC, svne);
            error = svne;
        }
       
        if (error == null || error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) {
            wcAccess.close();
        }
       
        if (error != null && error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) {
            external.getParentFile().mkdirs();
            File newLocation = SVNFileUtil.createUniqueFile(external.getParentFile(), external.getName(), ".OLD", false);
            SVNFileUtil.rename(external, newLocation);
        } else if (error != null) {
            throw error;
View Full Code Here

                                                         -1 );
            if ( nodeKind == SVNNodeKind.NONE ) {
                SVNErrorMessage err = SVNErrorMessage.create( SVNErrorCode.UNKNOWN,
                                                              "No entry at URL ''{0}''",
                                                              url );
                throw new SVNException( err );
            } else if ( nodeKind == SVNNodeKind.FILE ) {
                SVNErrorMessage err = SVNErrorMessage.create( SVNErrorCode.UNKNOWN,
                                                              "Entry at URL ''{0}'' is a file while directory was expected",
                                                              url );
                throw new SVNException( err );
            }
        } catch ( SVNException e ) {
            e.printStackTrace();
            //logger.error( "svn error: " );
            throw e;
View Full Code Here

                                                         -1 );
            if ( nodeKind == SVNNodeKind.NONE ) {
                SVNErrorMessage err = SVNErrorMessage.create( SVNErrorCode.UNKNOWN,
                                                              "No entry at URL ''{0}''",
                                                              url );
                throw new SVNException( err );
            } else if ( nodeKind == SVNNodeKind.FILE ) {
                SVNErrorMessage err = SVNErrorMessage.create( SVNErrorCode.UNKNOWN,
                                                              "Entry at URL ''{0}'' is a file while directory was expected",
                                                              url );
                throw new SVNException( err );
            }
        } catch ( SVNException e ) {
            e.printStackTrace();
            //logger.error( "svn error: " );
            throw e;
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.SVNException

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.