Package org.mevenide.idea.repository

Examples of org.mevenide.idea.repository.PomRepoManager$FileFinder


        return artifacts.toArray(new Artifact[artifacts.size()]);
    }

    public static VirtualFile[] getPomClassPathFiles(final Project pProject, final String pPomUrl) {
        final PomRepoManager repoMgr = PomRepoManager.getInstance(pProject);

        final Artifact[] artifacts = getPomClassPathArtifacts(pProject, pPomUrl);
        final Set<VirtualFile> files = new HashSet<VirtualFile>(artifacts.length);

        for (Artifact artifact : artifacts) {
            final VirtualFile file = repoMgr.findFile(pPomUrl, artifact);
            if (file != null && file.isValid() && !file.isDirectory() && FileUtils.exists(file))
                files.add(file);
        }

        return files.toArray(new VirtualFile[files.size()]);
View Full Code Here


            final Library.ModifiableModel model = lib.getModifiableModel();

            //
            //calculate the dependency's location in the local repository
            //
            final PomRepoManager repoMgr = PomRepoManager.getInstance(project);
            final VirtualFile file = repoMgr.findFile(problem.getPomUrl(), artifact);
            if (file == null || !file.isValid() || !FileUtils.exists(file)) {
                final String msg = RES.get("dep.missing.problem.desc", artifact);
                UIUtils.showError(project, msg);
                return;
            }
View Full Code Here

        //
        //iterate over the project dependencies, and check each one if it
        //exists in the local repository
        //
        final PomRepoManager repoMgr = PomRepoManager.getInstance(pProject);
        final Artifact[] artifacts = PomUtils.getPomClassPathArtifacts(pProject, pPomUrl);
        for (Artifact artifact : artifacts) {
            if (!repoMgr.isInstalled(pPomUrl, artifact))
                problems.add(new DependencyNotDownloadedProblemInfo(pProject,
                                                                    pPomUrl,
                                                                    artifact));
        }
View Full Code Here

                                                 final String pPomUrl,
                                                 final Module pModule) {
        final Artifact[] pomLibs = PomUtils.getPomClassPathArtifacts(pModule.getProject(), pPomUrl);
        final VirtualFile[] ideaLibs = ModuleUtils.getModuleClasspath(pModule);

        final PomRepoManager repoMgr = PomRepoManager.getInstance(pModule.getProject());
        for (Artifact artifact : pomLibs) {
            final VirtualFile file = repoMgr.findFile(pPomUrl, artifact);
            if (file == null || !file.isValid() || !FileUtils.exists(file))
                continue;

            boolean found = false;
            for (VirtualFile ideaFile : ideaLibs)
View Full Code Here

        public boolean isValid() {
            if (!PomUtils.isArtifactDeclared(getProject(), pomUrl, artifact))
                return false;

            final PomRepoManager repoMgr = PomRepoManager.getInstance(getProject());
            final VirtualFile file = repoMgr.findFile(pomUrl, artifact);
            if (file == null || !file.isValid() || !FileUtils.exists(file))
                return false;

            return !ModuleUtils.isFileInClasspath(module, file);
        }
View Full Code Here

            //
            //find the local repository - if the file is not under the
            //local repo, we cannot derive the group and artifact ids,
            //and therefor we cannot fix the problem (return empty array)
            //
            final PomRepoManager pomMgr = PomRepoManager.getInstance(module.getProject());
            final VirtualFile localRepo = pomMgr.getLocalRepositoryDirectory(pPomUrl);
            if (localRepo != null && VfsUtil.isAncestor(localRepo, libraryFile, true)) {
                addFixAction(new AddLibraryToPomAction(this, module));
                addFixAction(new RemoveLibraryFromModuleAction(this, module));
            }
        }
View Full Code Here

        private Throwable error = null;

        public void run() {
            error = null;
            try {
                final PomRepoManager mgr = PomRepoManager.getInstance(problem.getProject());
                mgr.download(problem.getPomUrl(), problem.getArtifact());
            }
            catch (Exception e) {
                error = e;
            }
        }
View Full Code Here

        return true;
    }

    public void actionPerformed(final AnActionEvent pEvent) {
        final Project project = getProject(pEvent);
        final PomRepoManager mgr = PomRepoManager.getInstance(project);
        final String repoUrl = mgr.selectDestinationRepo(DLG_TITLE, DLG_LABEL);
        if (repoUrl == null)
            return;

        //
        //prepare list of path elements to download
        //
        final RepoPathElement[] pathElements = getSelectedItems();
        final Runnable downloader = new Runnable() {
            public void run() {
                for (RepoPathElement element : pathElements) {
                    try {
                        //TODO: show returned VirtualFile(s) in Results pane
                        mgr.download(repoUrl, element);
                    }
                    catch (ArtifactNotFoundException e) {
                        //TODO: accumulate errors and display once
                        UIUtils.showError(project, e);
                    }
View Full Code Here

TOP

Related Classes of org.mevenide.idea.repository.PomRepoManager$FileFinder

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.