Package org.apache.tika.server.core
Class TikaServerConfig
java.lang.Object
org.apache.tika.config.ConfigBase
org.apache.tika.server.core.TikaServerConfig
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Number of milliseconds to wait for forked process to startupstatic final String
static final long
Clients may not set a timeout less than this amount.static final int
static final long
How often to check to see that the task hasn't timed outstatic final long
Number of milliseconds to wait per server task (parse, detect, unpack, translate, etc.) before timing out and shutting down the forked process. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCors()
digest configuration string, e.g. md5 or sha256, alternately w 16 or 32 encoding, e.g. md5:32,sha256:16 would result in two digests per fileint
getForkedProcessArgs
(int port, String id) getForkedProcessArgs
(String portString, String id) getHost()
getId()
full path to the java executablelong
maximum number of files before the forked server restarts.long
Maximum time in millis to allow for the forked process to startup or restartint
long
int
getPort()
int[]
getPorts()
long
How often to check to see that a task has timed outlong
How long to wait for a task before shutting down the forked server process and restarting it.boolean
interpolateSysProps
(List<String> forkedJvmArgs) boolean
boolean
isNoFork()
boolean
boolean
static TikaServerConfig
load()
Config with only the defaultsstatic TikaServerConfig
load
(org.apache.commons.cli.CommandLine commandLine) void
setConfigPath
(String path) void
void
void
setDigestMarkLimit
(int digestMarkLimit) void
setEnableUnsecureFeatures
(boolean enableUnsecureFeatures) void
setEndpoints
(List<String> endpoints) void
setForkedJvmArgs
(List<String> forkedJvmArgs) void
void
void
setJavaPath
(String javaPath) void
setLogLevel
(String level) void
setMaxFiles
(long maxFiles) void
setMaxforkedStartupMillis
(long maxforkedStartupMillis) void
setMaxForkedStartupMillis
(long maxForkedStartupMillis) void
setMaxRestarts
(int maxRestarts) void
setMinimumTimeoutMillis
(long minimumTimeoutMillis) void
setNoFork
(boolean noFork) void
void
setPreventStopMethod
(boolean preventStopMethod) void
setReturnStackTrace
(boolean returnStackTrace) void
setTaskPulseMillis
(long taskPulseMillis) void
setTaskTimeoutMillis
(long taskTimeoutMillis) void
setTlsConfig
(TlsConfig tlsConfig) Methods inherited from class org.apache.tika.config.ConfigBase
buildComposite, buildComposite, buildSingle, buildSingle, configure, handleSettings
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_HOST
- See Also:
-
LOG_LEVELS
-
DEFAULT_TASK_TIMEOUT_MILLIS
public static final long DEFAULT_TASK_TIMEOUT_MILLISNumber of milliseconds to wait per server task (parse, detect, unpack, translate, etc.) before timing out and shutting down the forked process.- See Also:
-
DEFAULT_MINIMUM_TIMEOUT_MILLIS
public static final long DEFAULT_MINIMUM_TIMEOUT_MILLISClients may not set a timeout less than this amount. This hinders malicious clients from setting the timeout to a very low value and DoS the server by forcing timeout restarts. Making tika-server available to untrusted clients is dangerous.- See Also:
-
DEFAULT_TASK_PULSE_MILLIS
public static final long DEFAULT_TASK_PULSE_MILLISHow often to check to see that the task hasn't timed out- See Also:
-
DEFAULT_FORKED_STARTUP_MILLIS
public static final long DEFAULT_FORKED_STARTUP_MILLISNumber of milliseconds to wait for forked process to startup- See Also:
-
-
Constructor Details
-
TikaServerConfig
public TikaServerConfig()
-
-
Method Details
-
load
Config with only the defaults -
load
public static TikaServerConfig load(org.apache.commons.cli.CommandLine commandLine) throws IOException, TikaException - Throws:
IOException
TikaException
-
interpolateSysProps
-
isNoFork
public boolean isNoFork() -
setNoFork
public void setNoFork(boolean noFork) -
getPort
-
setPort
-
getTaskTimeoutMillis
public long getTaskTimeoutMillis()How long to wait for a task before shutting down the forked server process and restarting it.- Returns:
-
setTaskTimeoutMillis
public void setTaskTimeoutMillis(long taskTimeoutMillis) - Parameters:
taskTimeoutMillis
- number of milliseconds to allow per task (parse, detection, unzipping, etc.)
-
getTaskPulseMillis
public long getTaskPulseMillis()How often to check to see that a task has timed out- Returns:
-
setTaskPulseMillis
public void setTaskPulseMillis(long taskPulseMillis) -
getMaxRestarts
public int getMaxRestarts() -
setMaxRestarts
public void setMaxRestarts(int maxRestarts) -
getMaxForkedStartupMillis
public long getMaxForkedStartupMillis()Maximum time in millis to allow for the forked process to startup or restart- Returns:
-
setMaxForkedStartupMillis
public void setMaxForkedStartupMillis(long maxForkedStartupMillis) -
getForkedProcessArgs
-
getForkedProcessArgs
-
getMinimumTimeoutMillis
public long getMinimumTimeoutMillis() -
setMinimumTimeoutMillis
public void setMinimumTimeoutMillis(long minimumTimeoutMillis) -
getIdBase
-
getJavaPath
full path to the java executable- Returns:
-
setJavaPath
-
getForkedJvmArgs
-
setForkedJvmArgs
-
getTempFilePrefix
-
isEnableUnsecureFeatures
public boolean isEnableUnsecureFeatures() -
setEnableUnsecureFeatures
public void setEnableUnsecureFeatures(boolean enableUnsecureFeatures) -
getHost
-
setHost
-
getLogLevel
-
setLogLevel
- Throws:
TikaConfigException
-
getCors
- Returns:
- the origin url for cors, can be "*"
-
setCors
-
hasConfigFile
public boolean hasConfigFile() -
getConfigPath
-
setConfigPath
-
getDigestMarkLimit
public int getDigestMarkLimit() -
setDigestMarkLimit
public void setDigestMarkLimit(int digestMarkLimit) -
getDigest
digest configuration string, e.g. md5 or sha256, alternately w 16 or 32 encoding, e.g. md5:32,sha256:16 would result in two digests per file- Returns:
-
setDigest
-
getMaxFiles
public long getMaxFiles()maximum number of files before the forked server restarts. This is useful for avoiding any slow-building memory leaks/bloat.- Returns:
-
setMaxFiles
public void setMaxFiles(long maxFiles) -
isReturnStackTrace
public boolean isReturnStackTrace() -
setReturnStackTrace
public void setReturnStackTrace(boolean returnStackTrace) -
getTlsConfig
-
setTlsConfig
-
getEndpoints
-
setEndpoints
-
getId
-
setId
-
getNumRestarts
public int getNumRestarts() -
getForkedStatusFile
-
setMaxforkedStartupMillis
public void setMaxforkedStartupMillis(long maxforkedStartupMillis) -
isPreventStopMethod
public boolean isPreventStopMethod() -
setPreventStopMethod
public void setPreventStopMethod(boolean preventStopMethod) -
getPorts
public int[] getPorts() -
getSupportedFetchers
-
getSupportedEmitters
-