@@ -529,7 +529,7 @@ public void process(Object obj){
529
529
StringBuilder str = new StringBuilder ();
530
530
str .append ("<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>\r \n " );
531
531
str .append ("<scripts>\r \n " );
532
- for (String link : getLinks (src , path )){
532
+ for (String link : getWildcardLinks (src , path )){
533
533
str .append ("<script src=\" " );
534
534
str .append (link );
535
535
str .append ("\" ></script>\r \n " );
@@ -580,7 +580,7 @@ else if (nodeName.equals("link")){
580
580
StringBuilder str = new StringBuilder ();
581
581
str .append ("<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>\r \n " );
582
582
str .append ("<links>\r \n " );
583
- for (String link : getLinks (href , path )){
583
+ for (String link : getWildcardLinks (href , path )){
584
584
585
585
str .append ("<link href=\" " );
586
586
str .append (link );
@@ -618,7 +618,7 @@ else if (nodeName.equals("link")){
618
618
}
619
619
620
620
621
- private ArrayList <String > getLinks (String src , String path ) throws Exception {
621
+ private ArrayList <String > getWildcardLinks (String src , String path ) throws Exception {
622
622
623
623
//Get file path
624
624
javaxt .io .File f = new javaxt .io .File (path );
@@ -631,7 +631,7 @@ private ArrayList<String> getLinks(String src, String path) throws Exception {
631
631
int x = d .toString ().replace ("\\ " , "/" ).lastIndexOf (basePath );
632
632
633
633
634
- //Create new xml document
634
+ //Find files and return links
635
635
ArrayList <String > links = new ArrayList <>();
636
636
for (javaxt .io .File file : d .getFiles (search , true )){
637
637
long lastModified = file .getLastModifiedTime ().getTime ();
@@ -640,6 +640,14 @@ private ArrayList<String> getLinks(String src, String path) throws Exception {
640
640
641
641
String p = file .getDirectory ().toString ().replace ("\\ " , "/" ).substring (x );
642
642
links .add (p + file .getName () + "?v=" + currVersion );
643
+
644
+ //Files copied/pasted from another source may retain their
645
+ //original timestamp. If these includes are older than any
646
+ //other files, the newly added files will be missed on the
647
+ //next load/refresh. As a workaround, we'll include a
648
+ //timestamp of the parent folder. Copied folders will have a
649
+ //timestamp of when the folder was copied.
650
+ addDate (file .getDirectory ().getLastModifiedTime ().getTime ());
643
651
}
644
652
return links ;
645
653
}
0 commit comments