/** * Is this library contains classes folder instead of a jar? */ public static boolean isLibraryDirectoryBased(ClassPathSupport.Item item) { assert item.getType() == ClassPathSupport.Item.TYPE_LIBRARY : item; Library l = item.getLibrary(); List<URL> cp = l.getContent("classpath"); // NOI18N if (cp.size() > 0 && cp.get(0).toString().startsWith("file:")) { // NOI18N return true; } return false; }
if ( ((ClassPathSupport.Item)it.next()).isBroken() ) { broken = true; break;
/** * Updates the project helper with the list of classpath items which are to be * included in deployment. */ private static void putIncludedLibraries(List<Item> classpath, AntProjectHelper antProjectHelper, String includedLibrariesElement) { assert antProjectHelper != null; assert includedLibrariesElement != null; Element data = antProjectHelper.getPrimaryConfigurationData( true ); NodeList libs = data.getElementsByTagNameNS( AppClientProjectType.PROJECT_CONFIGURATION_NAMESPACE, includedLibrariesElement ); while ( libs.getLength() > 0 ) { Node n = libs.item( 0 ); n.getParentNode().removeChild( n ); } Document doc = data.getOwnerDocument(); //find a correcponding classpath item for the library for (ClassPathSupport.Item item : classpath) { if("true".equals(item.getAdditionalProperty(INCLUDE_IN_DEPLOYMENT))) { // NOI18N data.appendChild(createLibraryElement(antProjectHelper, doc, item, includedLibrariesElement)); } } antProjectHelper.putPrimaryConfigurationData( data, true ); }
if (item instanceof ClassPathSupport.Item) { ClassPathSupport.Item cpti = (ClassPathSupport.Item)item; String propertyName = cpti.getReference(); if(propertyName != null) { String libname = propertyName.substring("${libs.".length());
while(items.hasNext()) { ClassPathSupport.Item cpti = items.next(); String propertyName = cpti.getReference(); if(propertyName != null) { String libname = propertyName.substring("${libs.".length());
if (!item.isBroken()) { if (item.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { path = artifactItem.getDescription().getPathInDeployment(); if (path != null) { for (URL url : item.getLibrary().getContent("classpath")) { // FIXME is this OK ? URL norm = FileUtil.getArchiveFile(url); if (norm == null) { } else if (item.getType() == ClassPathSupport.Item.TYPE_ARTIFACT) { if (item.getArtifact().getProject().getLookup().lookup(J2eeModuleProvider.class) != null) { continue; File scriptLocation = item.getArtifact().getScriptLocation().getAbsoluteFile(); if (!scriptLocation.isDirectory()) { scriptLocation = scriptLocation.getParentFile(); for (URI artifactURI : item.getArtifact().getArtifactLocations()) { File file = null; if (artifactURI.isAbsolute()) { } else if (item.getType() == ClassPathSupport.Item.TYPE_JAR) { path = artifactItem.getDescription().getPathInDeployment(); if (path != null) { File file = item.getResolvedFile(); if (file != null) { files.add(file);
if ( item.getType() == ClassPathSupport.Item.TYPE_ARTIFACT || item.getType() == ClassPathSupport.Item.TYPE_JAR ) { refHelper.destroyReference(item.getReference()); if (item.getType() == ClassPathSupport.Item.TYPE_JAR) { item.removeSourceAndJavadoc(updateHelper); if (item.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { String prop = item.getReference(); prop = prop.substring(2, prop.length()-1); ep.remove(prop);
if ( item.getType() == ClassPathSupport.Item.TYPE_ARTIFACT || item.getType() == ClassPathSupport.Item.TYPE_JAR ) { refHelper.destroyReference(item.getReference()); if (item.getType() == ClassPathSupport.Item.TYPE_JAR) { item.removeSourceAndJavadoc(updateHelper); if (item.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { String prop = item.getReference(); prop = prop.substring(2, prop.length()-1); ep.remove(prop);
if ( item.getType() == ClassPathSupport.Item.TYPE_ARTIFACT || item.getType() == ClassPathSupport.Item.TYPE_JAR ) { refHelper.destroyReference(item.getReference()); if (item.getType() == ClassPathSupport.Item.TYPE_JAR) { item.removeSourceAndJavadoc(updateHelper); if (item.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { String prop = item.getReference(); prop = prop.substring(2, prop.length()-1); ep.remove(prop);
if ( item.getType() == ClassPathSupport.Item.TYPE_ARTIFACT || item.getType() == ClassPathSupport.Item.TYPE_JAR ) { refHelper.destroyReference(item.getReference()); if (item.getType() == ClassPathSupport.Item.TYPE_JAR) { item.removeSourceAndJavadoc(updateHelper); if (item.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { String prop = item.getReference(); prop = CommonProjectUtils.getAntPropertyName(prop); ep.remove(prop);
for (Iterator it = ClassPathUiSupport.getIterator(models[i]); it.hasNext();) { ClassPathSupport.Item itm = (ClassPathSupport.Item) it.next(); if (itm.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { itm.reassignLibraryManager(man);
for (Iterator it = ClassPathUiSupport.getIterator(models[i]); it.hasNext();) { ClassPathSupport.Item itm = (ClassPathSupport.Item) it.next(); if (itm.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { itm.reassignLibraryManager(man);
for (Iterator it = ClassPathUiSupport.getIterator(models[i]); it.hasNext();) { ClassPathSupport.Item itm = (ClassPathSupport.Item) it.next(); if (itm.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { itm.reassignLibraryManager(man);
for (Iterator it = ClassPathUiSupport.getIterator(models[i]); it.hasNext();) { ClassPathSupport.Item itm = (ClassPathSupport.Item) it.next(); if (itm.getType() == ClassPathSupport.Item.TYPE_LIBRARY) { itm.reassignLibraryManager(man);
if ( ((ClassPathSupport.Item)it.next()).isBroken() ) { broken = true; break;
if ( ((ClassPathSupport.Item)it.next()).isBroken() ) { broken = true; break;
if ( ((ClassPathSupport.Item)it.next()).isBroken() ) { broken = true; break;
public void tableChanged(TableModelEvent e) { if (e.getColumn() != 1) { return; } TableModel listModel = uiProperties.WAR_CONTENT_ADDITIONAL_MODEL; ClassPathSupport.Item cpItem = (ClassPathSupport.Item) listModel.getValueAt(e.getFirstRow(), 0); String newPathInWar = (String) listModel.getValueAt(e.getFirstRow(), 1); String message = null; if (cpItem.getType() == ClassPathSupport.Item.TYPE_JAR && newPathInWar.startsWith("WEB-INF")) { //NOI18N if (newPathInWar.equals("WEB-INF\\lib") || newPathInWar.equals("WEB-INF/lib")) { //NOI18N if (cpItem.getResolvedFile().isDirectory()) { message = NbBundle.getMessage(CustomizerWar.class, "MSG_NO_FOLDER_IN_WEBINF_LIB", newPathInWar); // NOI18N } else { message = NbBundle.getMessage(CustomizerWar.class, "MSG_NO_FILE_IN_WEBINF_LIB", newPathInWar); // NOI18N } } else if (newPathInWar.equals("WEB-INF\\classes") || newPathInWar.equals("WEB-INF/classes")) { //NOI18N message = NbBundle.getMessage(CustomizerWar.class, "MSG_NO_FOLDER_IN_WEBINF_CLASSES", newPathInWar); // NOI18N } } if (message != null) { DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message (message, NotifyDescriptor.WARNING_MESSAGE)); } } }
/** * Updates the project helper with the list of classpath items which are to be * included in deployment. */ private static void putIncludedLibraries( List<Item> classpath, AntProjectHelper antProjectHelper, String webModuleLibraries ) { assert antProjectHelper != null; assert webModuleLibraries != null; Element data = antProjectHelper.getPrimaryConfigurationData( true ); Document doc = data.getOwnerDocument(); Element webModuleLibs = (Element) data.getElementsByTagNameNS(WebProjectType.PROJECT_CONFIGURATION_NAMESPACE, webModuleLibraries).item(0); if (webModuleLibs == null) { webModuleLibs = doc.createElementNS(WebProjectType.PROJECT_CONFIGURATION_NAMESPACE, webModuleLibraries); //NOI18N data.appendChild(webModuleLibs); } while (webModuleLibs.hasChildNodes()) { webModuleLibs.removeChild(webModuleLibs.getChildNodes().item(0)); } for (Item item : classpath) { webModuleLibs.appendChild(createLibraryElement(antProjectHelper, doc, CommonProjectUtils.getAntPropertyName( item.getReference() ), item)); } antProjectHelper.putPrimaryConfigurationData( data, true ); }
/** * Updates the project helper with the list of classpath items which are to be * included in deployment. */ private static void putIncludedLibraries(List<ClassPathSupport.Item> classpath, AntProjectHelper antProjectHelper, String includedLibrariesElement ) { assert antProjectHelper != null; assert includedLibrariesElement != null; Element data = antProjectHelper.getPrimaryConfigurationData( true ); NodeList libs = data.getElementsByTagNameNS( EjbJarProjectType.PROJECT_CONFIGURATION_NAMESPACE, includedLibrariesElement ); while ( libs.getLength() > 0 ) { Node n = libs.item( 0 ); n.getParentNode().removeChild( n ); } Document doc = data.getOwnerDocument(); for (ClassPathSupport.Item item : classpath) { if("true".equals(item.getAdditionalProperty(INCLUDE_IN_DEPLOYMENT))) { // NOI18N XMLUtil.appendChildElement(data, createLibraryElement(antProjectHelper, doc, item, includedLibrariesElement), ejbjarElemOrder); } } antProjectHelper.putPrimaryConfigurationData( data, true ); }