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

20 lines
435 B
Java

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();
this.file = f.length() >= 1048576 ? null : Files.readAllBytes(f.toPath());
this.timestamp = System.currentTimeMillis();
}
}