tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject [3/3] tomee-site-generator git commit: Fix the listing for what resources a version has
Date Sun, 02 Dec 2018 11:07:00 GMT
Fix the listing for what resources a version has


Project: http://git-wip-us.apache.org/repos/asf/tomee-site-generator/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee-site-generator/commit/0f90a6ac
Tree: http://git-wip-us.apache.org/repos/asf/tomee-site-generator/tree/0f90a6ac
Diff: http://git-wip-us.apache.org/repos/asf/tomee-site-generator/diff/0f90a6ac

Branch: refs/heads/master
Commit: 0f90a6acf1f80ae0d6d0ab9b9602842390938965
Parents: 11df0fd
Author: dblevins <david.blevins@gmail.com>
Authored: Sun Dec 2 03:06:36 2018 -0800
Committer: dblevins <david.blevins@gmail.com>
Committed: Sun Dec 2 03:06:36 2018 -0800

----------------------------------------------------------------------
 src/main/java/org/apache/tomee/website/VersionIndex.java  | 10 ++--------
 src/main/java/org/apache/tomee/website/VersionsIndex.java |  4 ++--
 2 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee-site-generator/blob/0f90a6ac/src/main/java/org/apache/tomee/website/VersionIndex.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/tomee/website/VersionIndex.java b/src/main/java/org/apache/tomee/website/VersionIndex.java
index 68960aa..462b1d0 100644
--- a/src/main/java/org/apache/tomee/website/VersionIndex.java
+++ b/src/main/java/org/apache/tomee/website/VersionIndex.java
@@ -17,15 +17,9 @@
 package org.apache.tomee.website;
 
 import org.apache.openejb.loader.IO;
-import org.apache.openejb.util.Join;
 
 import java.io.File;
 import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 public class VersionIndex {
 
@@ -50,10 +44,10 @@ public class VersionIndex {
                     .append("\n")
             ;
 
-            if (docs.exists()) {
+            if (docs.exists() && docs.listFiles().length > 0) {
                 index.append(" - link:docs[Documentation]\n");
             }
-            if (examples.exists()) {
+            if (examples.exists() && examples.listFiles().length > 0) {
                 index.append(" - link:examples[Examples]\n");
             }
 

http://git-wip-us.apache.org/repos/asf/tomee-site-generator/blob/0f90a6ac/src/main/java/org/apache/tomee/website/VersionsIndex.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/tomee/website/VersionsIndex.java b/src/main/java/org/apache/tomee/website/VersionsIndex.java
index d44def4..8d73ccc 100644
--- a/src/main/java/org/apache/tomee/website/VersionsIndex.java
+++ b/src/main/java/org/apache/tomee/website/VersionsIndex.java
@@ -50,10 +50,10 @@ public class VersionsIndex {
                 final File docs = sources.getDestinationFor(source, "docs");
                 final File examples = sources.getDestinationFor(source, "examples");
 
-                if (docs.exists()) {
+                if (docs.exists() && docs.listFiles().length > 0) {
                     index.append(" - link:").append(source.getName()).append("/docs[Documentation]\n");
                 }
-                if (examples.exists()) {
+                if (examples.exists() && examples.listFiles().length > 0) {
                     index.append(" - link:").append(source.getName()).append("/examples[Examples]\n");
                 }
                 index.append("\n\n");


Mime
View raw message