Changeset 5711
- Timestamp:
- 2003-10-23T10:44:45+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r5708 r5711 708 708 } 709 709 710 /** Determines if the given file is a descendant of the folder described. 711 * @param pos_parent the possible parent folder as a String 712 * @param child the child File which we are checking 713 * @return true if the child is a descendant of the pos_parent, false otherwise 714 */ 715 static public boolean isParentFolderOf(String pos_parent, File child) { 716 while(child != null) { 717 if(pos_parent.equals(child.getAbsolutePath())) { 718 return true; 719 } 720 // Just keep looping checking each of childs parent folders. Not a brilliantly efficient algorithm, but it should still be pretty fast compared to the algorithm for merging elements. 721 child = child.getParentFile(); 722 } 723 return false; 724 } 725 710 726 /** Method to determine if the host system is Microsoft Windows based. 711 727 * @return A <i>boolean</i> which is <i>true</i> if the platform is Windows, <i>false</i> otherwise.
Note:
See TracChangeset
for help on using the changeset viewer.