Package org.netbeans.api.project.libraries

Examples of org.netbeans.api.project.libraries.LibraryManager


        }
    }

    private void switchLibrary() {
        String loc = librariesLocation.getText();
        LibraryManager man;
        if (loc.trim().length() > -1) {
            try {
                File base = FileUtil.toFile(uiProperties.getProject().getProjectDirectory());
                File location = FileUtil.normalizeFile(PropertyUtils.resolveFile(base, loc));
                URL url = location.toURI().toURL();
View Full Code Here


    private static final String LIBRARY_NAME_PREFIX = "Ivy_Library_";

    @Override
    public void update(ProjectPreferences preferences, List<ParsedConfArtifacts> parsedArtifacts) {
        URL libraryLocation = preferences.getSharedLibraryLocation();
        LibraryManager manager = LibraryManager.forLocation(libraryLocation);
        for (ParsedConfArtifacts parsedConfArtifacts : parsedArtifacts) {
            try {
                String libraryName = getLibraryName(parsedConfArtifacts.getConf());
                Library library = manager.getLibrary(libraryName);
                Map<String, List<URI>> libraryEntries = convertParsedArtifacts(parsedConfArtifacts);
                if (library != null) {
                    manager.removeLibrary(library);
                }
                manager.createURILibrary("j2se", libraryName, libraryEntries);
            } catch (IOException ex) {
                Exceptions.printStackTrace(ex);
            }
        }
    }
View Full Code Here

    }

    @Override
    public void removeIvyArtifacts(ProjectPreferences preferences) {
        URL libraryLocation = preferences.getSharedLibraryLocation();
        LibraryManager manager = LibraryManager.forLocation(libraryLocation);
        Library[] librarys = manager.getLibraries();
        for (Library library : librarys) {
            if (library.getName().startsWith(LIBRARY_NAME_PREFIX)) {
                try {
                    manager.removeLibrary(library);
                } catch (IOException ex) {
                    Exceptions.printStackTrace(ex);
                } catch (IllegalArgumentException ex) {
                    Exceptions.printStackTrace(ex);
                }
View Full Code Here

TOP

Related Classes of org.netbeans.api.project.libraries.LibraryManager

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.