Interface AbstractFile

  • All Known Implementing Classes:
    CommonAbstractFile, FTPFile, LocalFile, SFTPFile

    public interface AbstractFile
    Expected to be stateless (store statuses in corresponding AbstractFileSystem) and thread safe. Don't forget to implements hashCode, equals and toString.
    • Method Detail

      • getPath

        String getPath()
        Returns:
        always with '/' as directory separators
      • getParent

        AbstractFile getParent()
        Returns:
        null if not parent (this is root dir)
      • length

        long length()
      • exists

        boolean exists()
      • delete

        void delete()
        Not recursive.
      • isDirectory

        boolean isDirectory()
      • isFile

        boolean isFile()
      • isLink

        boolean isLink()
      • isSpecial

        boolean isSpecial()
      • isHidden

        boolean isHidden()
        Returns:
        marked "hidden" or is a dotfile
      • lastModified

        long lastModified()
      • mkdir

        void mkdir()
      • toCache

        default CachedFileAttributes toCache()
        Returns:
        a read-only cached data version of this AbstractFile
      • toCachedList

        default Stream<CachedFileAttributes> toCachedList()
        Returns:
        a read-only cached list data version of AbstractFile.list
      • normalizePath

        static String normalizePath​(String path)