/** * Constructs {@link Type} object * * * @param name * @param displayName */ public Type(String name, String displayName) { AssertUtil.assertIsNotEmpty(name); this.name = name; if (Util.isNotEmpty(displayName)) { this.displayName = displayName; } else { this.displayName = name; } }
/** * Constructs {@link Type} object * * * @param name * @param displayName */ public Type(String name, String displayName) { AssertUtil.assertIsNotEmpty(name); this.name = name; if (Util.isNotEmpty(displayName)) { this.displayName = displayName; } else { this.displayName = name; } }
/** * Method description * * * @return */ @Override public String getPathInfo() { String pathInfo = super.getPathInfo(); AssertUtil.assertIsNotEmpty(pathInfo); Repository repository = repositoryProvider.get(); if (repository != null) { if (pathInfo.startsWith(HttpUtil.SEPARATOR_PATH)) { pathInfo = pathInfo.substring(1); } pathInfo = pathInfo.substring(repository.getName().length()); } return pathInfo; }
/** * Method description * * * @param value * * @return */ @Override public String encrypt(String value) { String result = null; try { AssertUtil.assertIsNotEmpty(value); MessageDigest messageDigest = MessageDigest.getInstance(digest); result = encrypt(messageDigest, value); } catch (NoSuchAlgorithmException ex) { throw new EncryptionException(ex); } return result; }
/** * Method description * * * @param repository * * @return */ @Override public ChangesetViewer getChangesetViewer(Repository repository) { HgChangesetViewer changesetViewer = null; AssertUtil.assertIsNotNull(repository); String type = repository.getType(); AssertUtil.assertIsNotEmpty(type); if (TYPE_NAME.equals(type)) { changesetViewer = new HgChangesetViewer(this, jaxbContext, hgContextProvider.get(), repository); } else { throw new IllegalArgumentException("mercurial repository is required"); } return changesetViewer; }
/** * Method description * * * @param value * * @return */ @Override public String encrypt(String value) { String result = null; try { AssertUtil.assertIsNotEmpty(value); MessageDigest messageDigest = MessageDigest.getInstance(digest); result = encrypt(messageDigest, value); } catch (NoSuchAlgorithmException ex) { throw new EncryptionException(ex); } return result; }
/** * Method description * * * @param repository * * @return * * @throws RepositoryException */ @Override public DiffViewer getDiffViewer(Repository repository) throws RepositoryException { DiffViewer diffViewer = null; AssertUtil.assertIsNotNull(repository); String type = repository.getType(); AssertUtil.assertIsNotEmpty(type); if (TYPE_NAME.equals(type)) { diffViewer = new HgDiffViewer(this, hgContextProvider.get(), repository); } else { throw new IllegalArgumentException("mercurial repository is required"); } return diffViewer; }
/** * Method description * * * @param repository * * @return */ @Override public BlameViewer getBlameViewer(Repository repository) { SvnBlameViewer blameViewer = null; AssertUtil.assertIsNotNull(repository); String type = repository.getType(); AssertUtil.assertIsNotEmpty(type); if (TYPE_NAME.equals(type)) { blameViewer = new SvnBlameViewer(this, repository); } else { throw new IllegalArgumentException("svn repository is required"); } return blameViewer; }
/** * Method description * * * @param repository * * @return */ @Override public ChangesetViewer getChangesetViewer(Repository repository) { SvnChangesetViewer changesetViewer = null; AssertUtil.assertIsNotNull(repository); String type = repository.getType(); AssertUtil.assertIsNotEmpty(type); if (TYPE_NAME.equals(type)) { changesetViewer = new SvnChangesetViewer(this, repository); } else { throw new IllegalArgumentException("svn repository is required"); } return changesetViewer; }
/** * Method description * * * @param repository * * @return */ @Override public ChangesetViewer getChangesetViewer(Repository repository) { GitChangesetViewer changesetViewer = null; AssertUtil.assertIsNotNull(repository); String type = repository.getType(); AssertUtil.assertIsNotEmpty(type); if (TYPE_NAME.equals(type)) { changesetViewer = new GitChangesetViewer(this, repository); } else { throw new IllegalArgumentException("git repository is required"); } return changesetViewer; }
/** * Method description * * * @param repository * * @return */ @Override public BlameViewer getBlameViewer(Repository repository) { GitBlameViewer blameViewer = null; AssertUtil.assertIsNotNull(repository); String type = repository.getType(); AssertUtil.assertIsNotEmpty(type); if (TYPE_NAME.equals(type)) { blameViewer = new GitBlameViewer(this, repository); } else { throw new IllegalArgumentException("git repository is required"); } return blameViewer; }
/** * Method description * * * @param repository * * @return */ @Override public DiffViewer getDiffViewer(Repository repository) { SvnDiffViewer diffViewer = null; AssertUtil.assertIsNotNull(repository); String type = repository.getType(); AssertUtil.assertIsNotEmpty(type); if (TYPE_NAME.equals(type)) { diffViewer = new SvnDiffViewer(this, repository); } else { throw new IllegalArgumentException("svn repository is required"); } return diffViewer; }
/** * Method description * * * @return */ public static Credentials current() { String credentialsString = getCredentialsString(); AssertUtil.assertIsNotEmpty(credentialsString); credentialsString = CipherUtil.getInstance().decode(credentialsString); Credentials credentials = null; int index = credentialsString.indexOf(':'); if ((index > 0) && (index < credentialsString.length())) { //J- credentials = new Credentials( credentialsString.substring(0, index), credentialsString.substring(index + 1) ); //J+ } return credentials; }
/** * Method description * * * @param repository * * @return */ @Override public DiffViewer getDiffViewer(Repository repository) { GitDiffViewer diffViewer = null; AssertUtil.assertIsNotNull(repository); String type = repository.getType(); AssertUtil.assertIsNotEmpty(type); if (TYPE_NAME.equals(type)) { diffViewer = new GitDiffViewer(this, repository); } else { throw new IllegalArgumentException("git repository is required"); } return diffViewer; }
/** * Method description * * * @param repositoryId * @param revision * @param path * * @return * * * @throws IOException * @throws NotSupportedFeatuerException * @throws RepositoryException */ public BlameResult getBlame(String repositoryId, String revision, String path) throws RepositoryException, NotSupportedFeatuerException, IOException { AssertUtil.assertIsNotEmpty(repositoryId); Repository repository = repositoryManager.get(repositoryId); if (repository == null) { throw new RepositoryNotFoundException( "could not find repository with id ".concat(repositoryId)); } return getBlame(repository, revision, path); }
/** * Method description * * * @param repositoryId * @param revision * @param path * * @return * * * @throws IOException * @throws NotSupportedFeatuerException * @throws RepositoryException */ public BlameResult getBlame(String repositoryId, String revision, String path) throws RepositoryException, NotSupportedFeatuerException, IOException { AssertUtil.assertIsNotEmpty(repositoryId); Repository repository = repositoryManager.get(repositoryId); if (repository == null) { throw new RepositoryNotFoundException( "could not find repository with id ".concat(repositoryId)); } return getBlame(repository, revision, path); }
/** * Method description * * * @param repositoryId * @param revision * @param path * * @return * * @throws IOException * @throws NotSupportedFeatuerException * @throws RepositoryException */ public BrowserResult getResult(String repositoryId, String revision, String path) throws RepositoryException, NotSupportedFeatuerException, IOException { AssertUtil.assertIsNotEmpty(repositoryId); Repository repository = repositoryManager.get(repositoryId); if (repository == null) { throw new RepositoryNotFoundException( "could not find repository with id ".concat(repositoryId)); } return getResult(repository, revision, path); }
/** * Method description * * * @param repositoryId * @param path * @param revision * @param start * @param max * * @return * * * @throws IOException * @throws NotSupportedFeatuerException * @throws RepositoryException */ public ChangesetPagingResult getChangesets(String repositoryId, String path, String revision, int start, int max) throws IOException, RepositoryException, NotSupportedFeatuerException { AssertUtil.assertIsNotEmpty(repositoryId); Repository repository = repositoryManager.get(repositoryId); if (repository == null) { throw new RepositoryNotFoundException( "could not find repository with id ".concat(repositoryId)); } return getChangesets(repository, path, revision, start, max); }
/** * Method description * * * @param repositoryId * @param start * @param max * * @return * * * @throws IOException * @throws NotSupportedFeatuerException * @throws RepositoryException */ public ChangesetPagingResult getChangesets(String repositoryId, int start, int max) throws IOException, RepositoryException, NotSupportedFeatuerException { AssertUtil.assertIsNotEmpty(repositoryId); Repository repository = repositoryManager.get(repositoryId); if (repository == null) { throw new RepositoryNotFoundException( "could not find repository with id ".concat(repositoryId)); } return getChangesets(repository, start, max); }
throws IOException, RepositoryException AssertUtil.assertIsNotEmpty(revision); AssertUtil.assertIsNotNull(output);