Package org.mevenide.repository

Examples of org.mevenide.repository.IRepositoryReader


        if (pPomUrls.length == 1)
            return pPomUrls[0];

        final String[] repoUrls = new String[pPomUrls.length];
        for (int i = 0; i < pPomUrls.length; i++) {
            final IRepositoryReader localRepo = getLocalRepositoryReader(pPomUrls[i]);
            final URI uri = localRepo.getRootURI();
            final File rootFile = new File(uri);
            repoUrls[i] = rootFile.getAbsolutePath();
        }

        final String title;
View Full Code Here


        return repos;
    }

    public VirtualFile getLocalRepositoryDirectory(final String pPomUrl) {
        final IRepositoryReader localRepo = getLocalRepositoryReader(pPomUrl);
        if (localRepo == null)
            return null;

        final URI localRepoRootUri = localRepo.getRootURI();
        try {
            return VfsUtil.findFileByURL(localRepoRootUri.toURL());
        }
        catch (MalformedURLException e) {
            LOG.error(e.getMessage(), e);
View Full Code Here

        return repos.values().toArray(new IRepositoryReader[repos.size()]);
    }

    public IRepositoryReader[] getRepositoryReaders(final String pPomUrl) {
        final IRepositoryReader[] remote = getRemoteRepositoryReaders(pPomUrl);
        final IRepositoryReader local = getLocalRepositoryReader(pPomUrl);
        if (local == null)
            return remote;

        final IRepositoryReader[] all = new IRepositoryReader[remote.length + 1];
        System.arraycopy(remote, 0, all, 0, remote.length);
View Full Code Here

    public boolean isInstalled(final String pPomUrl, final RepoPathElement pElement) {
        return isInstalled(pPomUrl, Artifact.fromRepoPathElement(pElement).getCompleteArtifact());
    }

    public boolean isInstalled(final String pPomUrl, final Artifact pArtifact) {
        final IRepositoryReader localRepo = getLocalRepositoryReader(pPomUrl);
        if (localRepo == null)
            return false;

        final URI localRepoRootUri = localRepo.getRootURI();
        try {
            final VirtualFile localRepoFile = VfsUtil.findFileByURL(localRepoRootUri.toURL());
            final FileFinder finder = new FileFinder(localRepoFile, pArtifact);
            IDEUtils.runCommand(project, finder);
            return finder.isFound();
View Full Code Here

                          final String pPath) throws IOException {
        //
        //calculated destination file location
        //
        final PomRepoManager pomRepoMgr = PomRepoManager.getInstance(project);
        final IRepositoryReader localRepo = pomRepoMgr.getLocalRepositoryReader(pPomUrl);
        final File localRepoRootDir = new File(localRepo.getRootURI());
        final File destFile = new File(localRepoRootDir, pPath);

        //
        //calculate remote URL
        //
View Full Code Here

    public static ChildrenFetchService getInstance() {
        return INSTANCE;
    }

    public Future<RepoPathElement[]> fetch(final RepoPathElement pPathElement) {
        final IRepositoryReader repo = pPathElement.getReader();

        if (!executors.containsKey(repo))
            executors.put(repo, Executors.newSingleThreadExecutor());

        final ExecutorService service = executors.get(repo);
        LOG.trace("Submitting fetch task for repo executor " + repo.getRootURI());
        return service.submit(new ChildFetcher(pPathElement));
    }
View Full Code Here

                                                                   cellHasFocus);
            if (c instanceof JLabel) {
                final JLabel label = (JLabel) c;

                if (value instanceof IRepositoryReader) {
                    final IRepositoryReader repo = (IRepositoryReader) value;
                    final URI uri = repo.getRootURI();
                    final String scheme = uri.getScheme();
                    if (scheme != null)
                        if (scheme.startsWith("file"))
                            label.setIcon(Icons.REPO_LOCAL);
                        else if (scheme.startsWith("http"))
                            label.setIcon(Icons.WEB_SERVER);
                        else
                            label.setIcon(Icons.REPO_TYPE_JAVADOC_JAR_OPEN);

                    label.setText(repo.getRootURI().toString());
                }
                else {
                    label.setText("(None)");
                    label.setIcon(null);
                }
View Full Code Here

                final Object selectedItem = repoComboBox.getSelectedItem();

                if (selectedItem == null || !(selectedItem instanceof IRepositoryReader))
                    treesCardLayout.show(treesPanel, EMPTY_TREE_NAME);
                else {
                    final IRepositoryReader repo = (IRepositoryReader) selectedItem;
                    showRepo(repo);
                }
            }
        });
View Full Code Here

        else
            return null;
    }

    private RepoTree getSelectedRepoTree() {
        final IRepositoryReader currentRepo = getCurrentRepo();
        if (currentRepo == null)
            return null;

        final Collection<RepoTree> trees = repos.values();
        for (RepoTree tree : trees) {
            final TreeModel treeModel = tree.getModel();
            if (!(treeModel instanceof RepoTreeModel))
                continue;

            final RepoTreeModel model = (RepoTreeModel) treeModel;
            final RepoTreeNode root = model.getRoot();
            if (root == null)
                continue;

            final RepoPathElement pathElement = root.getPathElement();
            if (pathElement == null)
                continue;

            final IRepositoryReader repo = pathElement.getReader();
            if (currentRepo.equals(repo))
                return tree;
        }

        return null;
View Full Code Here

TOP

Related Classes of org.mevenide.repository.IRepositoryReader

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.