/** Create a valid default for context path from project name. */ public static String createDefaultContext(String projectName) { return "/" + PropertyUtils.getUsablePropertyName(projectName); }
/** Create a valid default for context path from project name. */ private static String createDefaultContext(String projectName) { return "/" + (projectName != null ? PropertyUtils.getUsablePropertyName(projectName) : ""); }
@Override public String getName() { return PropertyUtils.getUsablePropertyName(getDisplayName()); }
@Override public String getName() { return PropertyUtils.getUsablePropertyName(getDisplayName()); }
private static String createAntName (String name) { if (name == null || name.length() == 0) { throw new IllegalArgumentException (); } String antName = PropertyUtils.getUsablePropertyName(name); if (platformExists (antName)) { String baseName = antName; int index = 1; antName = baseName + Integer.toString (index); while (platformExists (antName)) { index ++; antName = baseName + Integer.toString (index); } } return antName; }
private static String createAntName(String name) { if (name == null || name.length() == 0) { throw new IllegalArgumentException(); } String antName = PropertyUtils.getUsablePropertyName(name); if (platformExists(antName)) { String baseName = antName; int index = 1; antName = baseName + Integer.toString(index); while (platformExists(antName)) { index++; antName = baseName + Integer.toString(index); } } return antName; }
private static String createAntName (String name) { if (name == null || name.length() == 0) { throw new IllegalArgumentException (); } String antName = PropertyUtils.getUsablePropertyName(name); if (platformExists (antName)) { String baseName = antName; int index = 1; antName = baseName + Integer.toString (index); while (platformExists (antName)) { index ++; antName = baseName + Integer.toString (index); } } return antName; }
public void run () { ProjectInformation pi = project.getLookup().lookup(ProjectInformation.class); String oldDistJar = pi == null ? null : "${dist.dir}/"+PropertyUtils.getUsablePropertyName(pi.getDisplayName())+".jar"; //NOI18N EditableProperties ep = project.getUpdateHelper().getProperties (AntProjectHelper.PROJECT_PROPERTIES_PATH); String propValue = ep.getProperty("dist.jar"); //NOI18N if (oldDistJar != null && oldDistJar.equals (propValue)) { ep.put ("dist.jar","${dist.dir}/"+PropertyUtils.getUsablePropertyName(newName)+".jar"); //NOI18N project.getUpdateHelper().putProperties (AntProjectHelper.PROJECT_PROPERTIES_PATH,ep); } } });
public void run() { AntProjectHelper helper = project.getAntProjectHelper(); EditableProperties projectProps = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); String warName = (String) projectProps.get(WebProjectProperties.WAR_NAME); String warEarName = (String) projectProps.get(WebProjectProperties.WAR_EAR_NAME); String oldName = warName.substring(0, warName.length() - 4); if (warName.endsWith(".war") && oldName.equals(oldProjectName)) //NOI18N projectProps.put(WebProjectProperties.WAR_NAME, PropertyUtils.getUsablePropertyName(newName) + ".war"); //NOI18N if (warEarName.endsWith(".war") && oldName.equals(oldProjectName)) //NOI18N projectProps.put(WebProjectProperties.WAR_EAR_NAME, PropertyUtils.getUsablePropertyName(newName) + ".war"); //NOI18N ProjectWebModule wm = (ProjectWebModule) project.getLookup ().lookup(ProjectWebModule.class); if (wm != null) //should not be null wm.setContextPath("/" + newName); helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, projectProps); } });
public void run() { AntProjectHelper helper = project.getAntProjectHelper(); EditableProperties projectProps = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); EditableProperties privateProps = helper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH); String warName = (String) projectProps.get(WebProjectProperties.WAR_NAME); String warEarName = (String) projectProps.get(WebProjectProperties.WAR_EAR_NAME); String oldName = warName.substring(0, warName.length() - 4); if (warName.endsWith(".war") && oldName.equals(oldProjectName)) //NOI18N projectProps.put(WebProjectProperties.WAR_NAME, PropertyUtils.getUsablePropertyName(newName) + ".war"); //NOI18N if (warEarName.endsWith(".war") && oldName.equals(oldProjectName)) //NOI18N projectProps.put(WebProjectProperties.WAR_EAR_NAME, PropertyUtils.getUsablePropertyName(newName) + ".war"); //NOI18N ProjectWebModule wm = (ProjectWebModule) project.getLookup().lookup(ProjectWebModule.class); String serverId = privateProps.getProperty(WebProjectProperties.J2EE_SERVER_INSTANCE); String oldCP = wm.getContextPath(serverId); if (oldCP != null && oldName.equals(oldCP.substring(1))) wm.setContextPath(serverId, "/" + newName); //NOI18N helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, projectProps); } });
private String getServerLibraryName() { if (!serverLibraryCheckbox.isSelected() || !serverLibraryCheckbox.isEnabled()) { return null; } Deployment deployment = Deployment.getDefault(); String name = deployment.getServerDisplayName(deployment.getServerID(getSelectedServer())); // null can occur only if the server was removed somehow return (name == null) ? "" : PropertyUtils.getUsablePropertyName(name); // NOI18N }
ep.setProperty("dist.dir", "dist"); // NOI18N ep.setComment("dist.dir", new String[] {"# " + NbBundle.getMessage(J2SEProjectGenerator.class, "COMMENT_dist.dir")}, false); // NOI18N ep.setProperty("dist.jar", "${dist.dir}/" + PropertyUtils.getUsablePropertyName(name) + ".jar"); // NOI18N ep.setProperty("javac.classpath", new String[0]); // NOI18N ep.setProperty("build.sysclasspath", "ignore"); // NOI18N
ep.setProperty(EjbJarProjectProperties.JAR_NAME, PropertyUtils.getUsablePropertyName(name) + ".jar"); ep.setProperty(EjbJarProjectProperties.JAR_COMPRESS, "false");
String clsPth = CONTEXT_PATH_MODEL.getText(0, CONTEXT_PATH_MODEL.getLength()); if (clsPth == null) { clsPth = "/" + PropertyUtils.getUsablePropertyName(project.getName()); //NOI18N } else if (!isCorrectCP(clsPth)) { if (clsPth.startsWith("/")) //NOI18N clsPth = clsPth.substring(1); clsPth = "/" + PropertyUtils.getUsablePropertyName(clsPth); //NOI18N
ep.setProperty(AppClientProjectProperties.JAR_NAME, PropertyUtils.getUsablePropertyName(name) + ".jar"); // NOI18N ep.setProperty(AppClientProjectProperties.BUILD_EAR_CLASSES_DIR, "${"+AppClientProjectProperties.BUILD_DIR+"}/jar"); // NOI18N
ep.setProperty(WebProjectProperties.WAR_NAME, PropertyUtils.getUsablePropertyName(name) + ".war"); // NOI18N