Module-HTTPD/src/main/java/dev/plex/cache/CacheItem.java

20 lines
435 B
Java
Raw Normal View History

2022-04-17 23:21:44 +00:00
package dev.plex.cache;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
public class CacheItem
{
public String path;
public byte[] file;
public long timestamp;
public CacheItem(File f) throws IOException
{
this.path = f.getPath();
2022-04-17 23:54:10 +00:00
this.file = f.length() >= 1048576 ? null : Files.readAllBytes(f.toPath());
2022-04-17 23:21:44 +00:00
this.timestamp = System.currentTimeMillis();
}
}