Class SymbolicLinkFileFilter

  • All Implemented Interfaces:
    java.io.Serializable, FileFilter

    public class SymbolicLinkFileFilter
    extends java.lang.Object
    implements FileFilter, java.io.Serializable
    This filter accepts Files that are symbolic links.

    Example, showing how to print out a list of the current directory's symbolic link files:

     FileSystemManager fsManager = VFS.getManager();
     FileObject dir = fsManager.toFileObject(new File("."));
     FileObject[] files = dir.findFiles(new FileFilterSelector(SymbolicLinkFileFilter.SYMBOLIC));
     for (int i = 0; i < files.length; i++) {
         System.out.println(files[i]);
     }
     

    Example, showing how to print out a list of the current directory's actual (i.e. symbolic link) files:

     FileSystemManager fsManager = VFS.getManager();
     FileObject dir = fsManager.toFileObject(new File("."));
     FileObject[] files = dir.findFiles(new FileFilterSelector(SymbolicLinkFileFilter.ACTUAL));
     for (int i = 0; i < files.length; i++) {
         System.out.println(files[i]);
     }
     
    Since:
    2.4
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static FileFilter ACTUAL
      Singleton instance of visible filter.
      static FileFilter SYMBOLIC
      Singleton instance of hidden filter.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SymbolicLinkFileFilter()
      Restrictive constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(FileSelectInfo fileSelectInfo)
      Checks to see if the file is a symbolic link.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ACTUAL

        public static final FileFilter ACTUAL
        Singleton instance of visible filter.
    • Method Detail

      • accept

        public boolean accept​(FileSelectInfo fileSelectInfo)
                       throws FileSystemException
        Checks to see if the file is a symbolic link. Non-existing files won't be accepted.
        Specified by:
        accept in interface FileFilter
        Parameters:
        fileSelectInfo - the file to check
        Returns:
        true if the file is symbolic link, otherwise false.
        Throws:
        FileSystemException - Thrown for file system errors.