Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNException


         * -1 is value that may be used to specify HEAD (latest) revision.
         */
        SVNNodeKind nodeKind = repository.checkPath("", -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);
        }

        /*
         * Get latest repository revision. We will export repository contents at this very revision.
         */
 
View Full Code Here


            } else {
                try {
                    file.createNewFile();
                } catch (IOException e) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "error: cannot create new  file ''{0}''", file);
                    throw new SVNException(err);
                }
            }
        }
View Full Code Here

     */
    File exportDir = new File("exportované");
    if (exportDir.exists()) {
      SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR,
          "Path ''{0}'' already exists", exportDir);
      throw new SVNException(err);
    }
    exportDir.mkdirs();

    /*
     * Create an instance of SVNRepository class. This class is the main
     * entry point for all "low-level" Subversion operations supported by
     * Subversion protocol.
     *
     * These operations includes browsing, update and commit operations. See
     * SVNRepository methods javadoc for more details.
     */
    SVNRepository repository = SVNRepositoryFactory.create(url);

    /*
     * User's authentication information (name/password) is provided via an
     * ISVNAuthenticationManager instance. SVNWCUtil creates a default
     * authentication manager given user's name and password.
     *
     * Default authentication manager first attempts to use provided user
     * name and password and then falls back to the credentials stored in
     * the default Subversion credentials storage that is located in
     * Subversion configuration area. If you'd like to use provided user
     * name and password only you may use BasicAuthenticationManager class
     * instead of default authentication manager:
     *
     * authManager = new BasicAuthenticationsManager(userName,
     * userPassword);
     *
     * You may also skip this point - anonymous access will be used.
     */
    ISVNAuthenticationManager authManager = SVNWCUtil
        .createDefaultAuthenticationManager(userName, userPassword);
    repository.setAuthenticationManager(authManager);

    /*
     * Get type of the node located at URL we used to create SVNRepository. ""
     * (empty string) is path relative to that URL, -1 is value that mya be
     * used to specify HEAD (latest) revision.
     */
    SVNNodeKind nodeKind = repository.checkPath("", -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);
    }

    /*
     * Get latest repository revision. We will export repository contents at
     * this very revision.
View Full Code Here

        if (!newDir.mkdirs()) {
          SVNErrorMessage err = SVNErrorMessage.create(
              SVNErrorCode.IO_ERROR,
              "error: failed to add the directory ''{0}''.",
              newDir);
          throw new SVNException(err);
        }
      }
      System.out.println("dir added: " + path);
    }
View Full Code Here

      File file = new File(myRootDirectory, path);
      if (file.exists()) {
        SVNErrorMessage err = SVNErrorMessage.create(
            SVNErrorCode.IO_ERROR,
            "error: exported file ''{0}'' already exists!", file);
        throw new SVNException(err);
      }
      try {
        file.createNewFile();
      } catch (IOException e) {
        SVNErrorMessage err = SVNErrorMessage.create(
            SVNErrorCode.IO_ERROR,
            "error: cannot create new  file ''{0}''", file);
        throw new SVNException(err);
      }
    }
View Full Code Here

            wcAccess.handleEvent(event);
        }
    }

    private static void handleLeftLocalModificationsError(SVNException originalError) throws SVNException {
        SVNException error = null;
        for (error = originalError; error != null;) {
            if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) {
                break;
            }
            error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null;
        }
        if (error != null) {
            return;
        }
        throw originalError;
View Full Code Here

        keyStore.load(is, passphrase);
      }
    }
    catch (Throwable th) {
      SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, th);
      throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, th.getMessage(), null, SVNErrorMessage.TYPE_ERROR, th), th);
    }
    finally {
      SVNFileUtil.closeFile(is);
    }
    KeyManagerFactory kmf = null;
    KeyManager[] result = null;
    if (keyStore != null) {
      try {
        kmf = KeyManagerFactory.getInstance("SunX509");
        if (kmf != null) {
          kmf.init(keyStore, passphrase);
          result = kmf.getKeyManagers();
        }
      }
      catch (Throwable th) {
        SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, th);
        throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, th.getMessage()), th);
      }
    }
    return result;
  }
View Full Code Here

    myException = null;
    if (exception instanceof SVNException) {
      throw (SVNException)exception;
    }
    else if (exception != null) {
      throw new SVNException(SVNErrorMessage.UNKNOWN_ERROR_MESSAGE, exception);
    }
  }
View Full Code Here

        myDiffWindowCount = 0;
        myConnection.write("(w(s(s)))", new Object[]{"close-file", fileToken, textChecksum});
    }

    public SVNCommitInfo closeEdit() throws SVNException {
        SVNException e = null;
        try {
            myConnection.write("(w())", new Object[]{"close-edit"});
            myConnection.read("", null, true);

            myRepository.authenticate();
View Full Code Here

    public void abortEdit() throws SVNException {
        if (myIsAborted || myCloseCallback == null) {
            return;
        }
        myIsAborted = true;
        SVNException error = null;
        try {
            myConnection.write("(w())", new Object[]{"abort-edit"});
            myConnection.read("", null, true);
        } catch (SVNException e) {
            error = 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.