Changeset 4398


Ignore:
Timestamp:
2003-05-29T11:04:02+12:00 (21 years ago)
Author:
jmt12
Message:

2030085: Revised FileNodes symbolic link detection so it only checks under non-windows systems. This avoids the problem where windows has absolute path = .../Progra~1/... and canonical path = .../Program Files/...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/file/FileNode.java

    r4395 r4398  
    257257            }
    258258        }
    259         // Finally remove any files whose canonical path do not match their absolute one (ie symbolic links)
    260         for(int k = files.length; k != 0; k--) {
    261             try {
    262             if(!files[k-1].getAbsolutePath().equals(files[k-1].getCanonicalPath())) {
    263                 ///ystem.err.println("For file: " + files[k-1].getName());
    264                 ///ystem.err.println("Absolute Path:  " + files[k-1].getAbsolutePath());
    265                 ///ystem.err.println("Canonical Path: " + files[k-1].getCanonicalPath());
    266                 files = ArrayTools.remove(files, (k-1));
     259        // Finally remove any files whose canonical path do not match their absolute one (ie symbolic links). We only do this test under linux, because under windows there is no such thing as a symbolic link, and instead we suffer difficulties with the 16bit truncated file paths not being the same as the canonical ones (i.e Program Files => Progra~1).
     260        if(!Utility.isWindows()) {
     261            for(int k = files.length; k != 0; k--) {
     262            try {
     263                if(!files[k-1].getAbsolutePath().equals(files[k-1].getCanonicalPath())) {
     264                ///ystem.err.println("For file: " + files[k-1].getName());
     265                ///ystem.err.println("Absolute Path:  " + files[k-1].getAbsolutePath());
     266                ///ystem.err.println("Canonical Path: " + files[k-1].getCanonicalPath());
     267                files = ArrayTools.remove(files, (k-1));
     268                }
    267269            }
    268             }
    269             catch (IOException exception) {
    270             Gatherer.printStackTrace(exception);
     270            catch (IOException exception) {
     271                Gatherer.printStackTrace(exception);
     272            }
    271273            }
    272274        }
Note: See TracChangeset for help on using the changeset viewer.