Class DownloadedFile

java.lang.Object
com.codeborne.selenide.files.DownloadedFile

public class DownloadedFile extends Object
  • Constructor Details

    • DownloadedFile

      public DownloadedFile(File file, long lastModifiedTime, long size, Map<String,String> headers)
      Parameters:
      file - the downloaded file
      headers - map of http headers. NB! Map keys (header names) are LOWER CASE!
  • Method Details

    • getFile

      public File getFile()
    • getName

      public String getName()
    • extension

      public String extension()
    • size

      public long size()
    • hasContentDispositionHeader

      public boolean hasContentDispositionHeader()
    • getContentType

      public @Nullable String getContentType()
    • lastModifiedTime

      public long lastModifiedTime()
    • isFileModifiedLaterThan

      public boolean isFileModifiedLaterThan(long timestamp)
      Depending on OS, file modification time can have seconds precision, not milliseconds. We have to ignore the difference in milliseconds.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fileWithName

      public static DownloadedFile fileWithName(String fileName)
    • localFile

      public static DownloadedFile localFile(File file)