package io.undertow.server.handlers.resource;
import io.undertow.UndertowMessages;
import java.io.File;
public class FileResourceManager extends PathResourceManager {
public FileResourceManager(final File base) {
this(base, 1024, true, false, null);
}
public FileResourceManager(final File base, long transferMinSize) {
this(base, transferMinSize, true, false, null);
}
public FileResourceManager(final File base, long transferMinSize, boolean caseSensitive) {
this(base, transferMinSize, caseSensitive, false, null);
}
public FileResourceManager(final File base, long transferMinSize, boolean followLinks, final String... safePaths) {
this(base, transferMinSize, true, followLinks, safePaths);
}
protected FileResourceManager(long transferMinSize, boolean caseSensitive, boolean followLinks, final String... safePaths) {
super(transferMinSize, caseSensitive, followLinks, safePaths);
}
public FileResourceManager(final File base, long transferMinSize, boolean caseSensitive, boolean followLinks, final String... safePaths) {
super(base.toPath(), transferMinSize, caseSensitive, followLinks, safePaths);
}
public File getBase() {
return new File(base);
}
public FileResourceManager setBase(final File base) {
if (base == null) {
throw UndertowMessages.MESSAGES.argumentCannotBeNull("base");
}
String basePath = base.getAbsolutePath();
if (!basePath.endsWith("/")) {
basePath = basePath + '/';
}
this.base = basePath;
return this;
}
}