Package com.codeborne.selenide.files
Class DownloadedFile
java.lang.Object
com.codeborne.selenide.files.DownloadedFile
-
Constructor Summary
ConstructorsConstructorDescriptionDownloadedFile(File file, long lastModifiedTime, long size, Map<String, String> headers) -
Method Summary
Modifier and TypeMethodDescriptionstatic DownloadedFilefileWithName(String fileName) @Nullable StringgetFile()getName()booleanbooleanisFileModifiedLaterThan(long timestamp) Depending on OS, file modification time can have seconds precision, not milliseconds.longstatic DownloadedFilelongsize()toString()May be inaccurate for file on remote webdriver (and it's system time differs from the system time on test machine).
-
Constructor Details
-
DownloadedFile
- Parameters:
file- the downloaded fileheaders- map of http headers. NB! Map keys (header names) are LOWER CASE!
-
-
Method Details
-
getFile
-
getName
-
extension
-
size
public long size() -
hasContentDispositionHeader
public boolean hasContentDispositionHeader() -
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
May be inaccurate for file on remote webdriver (and it's system time differs from the system time on test machine). -
fileWithName
-
localFile
-