Class DownloadDetector

  • All Implemented Interfaces:
    java.io.Serializable, java.util.Comparator<DownloadedFile>

    public class DownloadDetector
    extends java.lang.Object
    implements java.util.Comparator<DownloadedFile>, java.io.Serializable
    Sort all downloaded files by "likeness" to be the right download.

    1. Response with "Content-Disposition" is most likely the right download. 2. Response with type "text/html", "text/plain", "text/css", "text/javascript", "application/json" are less likely the right download. 3. Latest file wins 4. The first file (alphabetically) wins

    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(DownloadedFile file1, DownloadedFile file2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • DownloadDetector

        public DownloadDetector()