Beispiel #1
0
 public String getCurrentVersion() {
   if (this.currentVersion == null) {
     this.currentVersion = getRoot().getTextTrim(CURRENT_VERSION);
     // sometimes a version is not set
     if (this.currentVersion == null) {
       this.currentVersion = "";
     }
     this.snapshot = RealPom.isSnapshot(this.currentVersion);
     if (this.snapshot) {
       this.currentVersion = StringHandler.remove(this.currentVersion, SNAPSHOT);
       this.currentVersion = StringHandler.remove(this.currentVersion, "-");
     }
   }
   return this.currentVersion;
 }
Beispiel #2
0
 public String getDescription() {
   StringBuffer buffer = new StringBuffer();
   // nafn
   add(buffer, getNafn());
   buffer.append(" - ");
   // merking human readable
   add(buffer, getMerkingHumanReadable());
   // eigandi
   if (StringHandler.isNotEmpty(getOwnerName())) {
     buffer.append(" (");
     buffer.append(getOwnerName());
     buffer.append(")");
   }
   // fastanumer
   buffer.append(" [Fastanr ");
   add(buffer, getFastaNumer());
   buffer.append("]");
   // matseining
   buffer.append(" Matseiningnr ");
   add(buffer, getMatseiningNumer());
   buffer.append(" ");
   // merking
   add(buffer, getMerking());
   buffer.append("]");
   // landnumer
   buffer.append(" [Landnúmer ");
   add(buffer, getLandnumer());
   buffer.append("] ");
   return buffer.toString();
 }
Beispiel #3
0
 public Pom getPom(DependencyPomBundle dependency) throws IOException {
   String dependencyArtifactId = dependency.getArtifactId();
   String moduleName =
       (isEclipseProject())
           ? dependencyArtifactId
           : StringHandler.concat(dependencyArtifactId, BUNDLE_SUFFIX);
   File bundlesFolder = getBundlesFolder(this.projectFile);
   File module = new File(bundlesFolder, moduleName);
   File dependencyProjectFile = new File(module, RealPom.POM_FILE);
   RealPom pom = RealPom.getPom(dependencyProjectFile);
   pom.setEclipseProject(isEclipseProject());
   pom.setIsInstalled(isInstalled());
   return pom;
 }
Beispiel #4
0
 public static XMLData createXMLData(File projectFile) throws IOException {
   XMLData pomData = XMLData.getInstanceForFile(projectFile);
   // handle extensions
   String superPom = pomData.getDocument().getRootElement().getTextTrim(EXTEND);
   // TODO thi: where can I fetch the value of the variable?
   if (superPom != null) {
     // replace if variable exists
     superPom = StringHandler.replace(superPom, BASE_PROJECT_VARIABLE, BASE_PROJECT_PATH);
     File superPomFile = FileUtil.getFileRelativeToFile(projectFile, superPom);
     if (superPomFile.exists()) {
       XMLData superPomData = createXMLData(superPomFile);
       // concat pomData and superPomData
       pomData.add(superPomData);
     }
   }
   return pomData;
 }
 private String getCategoryKey(ContentCategory category) {
   String clearedKey = StringHandler.stripNonRomanCharacters(category.getId());
   return new StringBuilder("contentcategory_").append(clearedKey).toString();
 }
Beispiel #6
0
 private void add(StringBuffer buffer, String value) {
   buffer.append(StringHandler.getStringOrDash(value));
 }
Beispiel #7
0
 public static boolean isSnapshot(String version) {
   return StringHandler.contains(version.toUpperCase(), SNAPSHOT);
 }