/** * @deprecated use {@link #getErrorMessage() } instead */ public SVNException getError() { if (myErrorMessage != null) { return new SVNException(getErrorMessage()); } return null; }
/** * @return exception occurred * @deprecated use {@link #getErrorMessage() } instead */ public SVNException getError() { if (myErrorMessage != null) { return new SVNException(getErrorMessage()); } return null; }
/** * @return exception occurred * @deprecated use {@link #getErrorMessage() } instead */ public SVNException getError() { if (myErrorMessage != null) { return new SVNException(getErrorMessage()); } return null; }
@NotNull private EntryUpdater getParent(@NotNull String parentToken) throws SVNException { final EntryUpdater parent = paths.get(parentToken); if (parent == null) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "Invalid path token: " + parentToken)); } return parent; }
private void changeDirProp(@NotNull SessionContext context, @NotNull ChangePropParams args) throws SVNException { final EntryUpdater dir = paths.get(args.token); if (dir == null) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "Invalid path token: " + args.token)); } changeProp(dir.props, args); }
@Override public void checkRead(@NotNull User user, @Nullable String path) throws SVNException, IOException { try { getProjectViaSudo(user); } catch (FileNotFoundException ignored) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "You're not authorized to read this project")); } }
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); } }
private void notImplementedYet(String message) throws ClientException { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, message == null ? "Requested SVNAdmin functionality is not yet implemented" : message); throwException(new SVNException(err), client); }
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); } }
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); } }
@Override public void checkWrite(@NotNull User user, @Nullable String path) throws SVNException { if (user.isAnonymous()) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "Anonymous user have not write access")); } checkRead(user, path); }
@Override public OutputStream textDeltaChunk(String path, SVNDiffWindow diffWindow) throws SVNException { if (window == null) throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_SVN_CMD_ERR)); return window.textDeltaChunk(diffWindow); }
@Override public void delete(@NotNull String name) throws SVNException, IOException { final GitTreeUpdate current = treeStack.element(); final GitTreeEntry entry = current.getEntries().remove(name); if (entry == null) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, getFullPath(name))); } }
@Override public void checkUpToDate(@NotNull String path, int rev, boolean checkLock) throws SVNException, IOException { final GitFile file = revision.getFile(path); if (file == null) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, path)); } else if (file.getLastChange().getId() > rev) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.WC_NOT_UP_TO_DATE, "Working copy is not up-to-date: " + path)); } if (checkLock) { checkLockFile(file); } }
@Override public Void call() throws SVNException { SVNErrorMessage err = new RemotableSVNErrorMessage(SVNErrorCode.UNKNOWN, "Just a test exception", new IllegalStateException("foo")); throw new SVNException(err); } }
@Override public void addDir(@NotNull String name, @Nullable VcsFile sourceDir) throws SVNException, IOException { final GitTreeUpdate current = treeStack.element(); if (current.getEntries().containsKey(name)) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.FS_ALREADY_EXISTS, getFullPath(name))); } final GitFile source = (GitFile) sourceDir; commitActions.add(action -> action.openDir(name)); treeStack.push(new GitTreeUpdate(name, repo.loadTree(source == null ? null : source.getTreeEntry()))); }
private void checkUpToDate(@NotNull VcsFile vcsFile, int rev, boolean checkLock) throws IOException, SVNException { if (vcsFile.getLastChange().getId() > rev) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.WC_NOT_UP_TO_DATE, "Working copy is not up-to-date: " + vcsFile.getFullPath())); } rootEntry.changes.add(treeBuilder -> treeBuilder.checkUpToDate(vcsFile.getFullPath(), rev, checkLock)); }
@Override public void checkWrite(@NotNull User user, @Nullable String path) throws SVNException, IOException { if (user.isAnonymous()) { throw new SVNException(SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "Anonymous access not allowed")); } } }
private void fixError(String path, SVNException e, SVNNodeKind kind) throws SVNException { SVNErrorMessage err = e.getErrorMessage(); if (err.getErrorCode() == SVNErrorCode.FS_NOT_FOUND || err.getErrorCode() == SVNErrorCode.RA_DAV_PATH_NOT_FOUND) { err = SVNErrorMessage.create(SVNErrorCode.WC_NOT_UP_TO_DATE, kind == SVNNodeKind.DIR ? "Directory ''{0}'' is out of date" : "File ''{0}'' is out of date", path); throw new SVNException(err); } throw e; }
private void fixError(String path, SVNException e, SVNNodeKind kind) throws SVNException { SVNErrorMessage err = e.getErrorMessage(); if (err.getErrorCode() == SVNErrorCode.FS_NOT_FOUND || err.getErrorCode() == SVNErrorCode.RA_DAV_PATH_NOT_FOUND) { err = SVNErrorMessage.create(SVNErrorCode.WC_NOT_UP_TO_DATE, kind == SVNNodeKind.DIR ? "Directory ''{0}'' is out of date" : "File ''{0}'' is out of date", path); throw new SVNException(err); } throw e; }