
apploader.lib.HeadResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apploader-lib Show documentation
Show all versions of apploader-lib Show documentation
Framework for delivering desktop application updates
The newest version!
package apploader.lib;
import java.io.File;
final class HeadResult {
final long lastModified;
final long length;
HeadResult(long lastModified, long length) {
this.lastModified = lastModified;
this.length = length;
}
static HeadResult fromFile(File file) {
if (file.exists()) {
return new HeadResult(file.lastModified(), file.length());
} else {
return null;
}
}
boolean isNeedUpdate(HeadResult local) {
if (local != null) {
if (this.lastModified > 0) {
return this.lastModified > local.lastModified;
} else {
return this.length != local.length;
}
} else {
return this.length >= 0;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy