Package org.apache.tika.server.core
Class TikaServerConfig
- java.lang.Object
- 
- org.apache.tika.config.ConfigBase
- 
- org.apache.tika.server.core.TikaServerConfig
 
 
- 
 public class TikaServerConfig extends ConfigBase 
- 
- 
Field SummaryFields Modifier and Type Field Description static longDEFAULT_FORKED_STARTUP_MILLISNumber of milliseconds to wait for forked process to startupstatic StringDEFAULT_HOSTstatic longDEFAULT_MINIMUM_TIMEOUT_MILLISClients may not set a timeout less than this amount.static intDEFAULT_PORTstatic longDEFAULT_TASK_PULSE_MILLISHow often to check to see that the task hasn't timed outstatic longDEFAULT_TASK_TIMEOUT_MILLISNumber of milliseconds to wait per server task (parse, detect, unpack, translate, etc.) before timing out and shutting down the forked process.static Set<String>LOG_LEVELS
 - 
Constructor SummaryConstructors Constructor Description TikaServerConfig()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PathgetConfigPath()StringgetCors()StringgetDigest()digest configuration string, e.g.intgetDigestMarkLimit()List<String>getEndpoints()List<String>getForkedJvmArgs()List<String>getForkedProcessArgs(int port, String id)List<String>getForkedProcessArgs(String portString, String id)StringgetForkedStatusFile()StringgetHost()StringgetId()StringgetIdBase()StringgetJavaPath()full path to the java executableStringgetLogLevel()longgetMaxFiles()maximum number of files before the forked server restarts.longgetMaxForkedStartupMillis()Maximum time in millis to allow for the forked process to startup or restartintgetMaxRestarts()longgetMinimumTimeoutMillis()intgetNumRestarts()StringgetPort()int[]getPorts()Set<String>getSupportedEmitters()Set<String>getSupportedFetchers()longgetTaskPulseMillis()How often to check to see that a task has timed outlonggetTaskTimeoutMillis()How long to wait for a task before shutting down the forked server process and restarting it.StringgetTempFilePrefix()TlsConfiggetTlsConfig()booleanhasConfigFile()protected static List<String>interpolateSysProps(List<String> forkedJvmArgs)booleanisEnableUnsecureFeatures()booleanisNoFork()booleanisPreventStopMethod()booleanisReturnStackTrace()static TikaServerConfigload()Config with only the defaultsstatic TikaServerConfigload(org.apache.commons.cli.CommandLine commandLine)voidsetConfigPath(String path)voidsetCors(String cors)voidsetDigest(String digest)voidsetDigestMarkLimit(int digestMarkLimit)voidsetEnableUnsecureFeatures(boolean enableUnsecureFeatures)voidsetEndpoints(List<String> endpoints)voidsetForkedJvmArgs(List<String> forkedJvmArgs)voidsetHost(String host)voidsetId(String id)voidsetJavaPath(String javaPath)voidsetLogLevel(String level)voidsetMaxFiles(long maxFiles)voidsetMaxforkedStartupMillis(long maxforkedStartupMillis)voidsetMaxForkedStartupMillis(long maxForkedStartupMillis)voidsetMaxRestarts(int maxRestarts)voidsetMinimumTimeoutMillis(long minimumTimeoutMillis)voidsetNoFork(boolean noFork)voidsetPort(String port)voidsetPreventStopMethod(boolean preventStopMethod)voidsetReturnStackTrace(boolean returnStackTrace)voidsetTaskPulseMillis(long taskPulseMillis)voidsetTaskTimeoutMillis(long taskTimeoutMillis)voidsetTlsConfig(TlsConfig tlsConfig)- 
Methods inherited from class org.apache.tika.config.ConfigBasebuildComposite, buildComposite, buildSingle, buildSingle, configure, handleSettings
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_PORTpublic static final int DEFAULT_PORT - See Also:
- Constant Field Values
 
 - 
DEFAULT_HOSTpublic static final String DEFAULT_HOST - See Also:
- Constant Field Values
 
 - 
DEFAULT_TASK_TIMEOUT_MILLISpublic static final long DEFAULT_TASK_TIMEOUT_MILLIS Number of milliseconds to wait per server task (parse, detect, unpack, translate, etc.) before timing out and shutting down the forked process.- See Also:
- Constant Field Values
 
 - 
DEFAULT_MINIMUM_TIMEOUT_MILLISpublic static final long DEFAULT_MINIMUM_TIMEOUT_MILLIS Clients 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:
- Constant Field Values
 
 - 
DEFAULT_TASK_PULSE_MILLISpublic static final long DEFAULT_TASK_PULSE_MILLIS How often to check to see that the task hasn't timed out- See Also:
- Constant Field Values
 
 - 
DEFAULT_FORKED_STARTUP_MILLISpublic static final long DEFAULT_FORKED_STARTUP_MILLIS Number of milliseconds to wait for forked process to startup- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
loadpublic static TikaServerConfig load() Config with only the defaults
 - 
loadpublic static TikaServerConfig load(org.apache.commons.cli.CommandLine commandLine) throws IOException, TikaException - Throws:
- IOException
- TikaException
 
 - 
isNoForkpublic boolean isNoFork() 
 - 
setNoForkpublic void setNoFork(boolean noFork) 
 - 
getPortpublic String getPort() 
 - 
setPortpublic void setPort(String port) 
 - 
getTaskTimeoutMillispublic long getTaskTimeoutMillis() How long to wait for a task before shutting down the forked server process and restarting it.- Returns:
 
 - 
setTaskTimeoutMillispublic void setTaskTimeoutMillis(long taskTimeoutMillis) - Parameters:
- taskTimeoutMillis- number of milliseconds to allow per task (parse, detection, unzipping, etc.)
 
 - 
getTaskPulseMillispublic long getTaskPulseMillis() How often to check to see that a task has timed out- Returns:
 
 - 
setTaskPulseMillispublic void setTaskPulseMillis(long taskPulseMillis) 
 - 
getMaxRestartspublic int getMaxRestarts() 
 - 
setMaxRestartspublic void setMaxRestarts(int maxRestarts) 
 - 
getMaxForkedStartupMillispublic long getMaxForkedStartupMillis() Maximum time in millis to allow for the forked process to startup or restart- Returns:
 
 - 
setMaxForkedStartupMillispublic void setMaxForkedStartupMillis(long maxForkedStartupMillis) 
 - 
getMinimumTimeoutMillispublic long getMinimumTimeoutMillis() 
 - 
setMinimumTimeoutMillispublic void setMinimumTimeoutMillis(long minimumTimeoutMillis) 
 - 
getIdBasepublic String getIdBase() 
 - 
getJavaPathpublic String getJavaPath() full path to the java executable- Returns:
 
 - 
setJavaPathpublic void setJavaPath(String javaPath) 
 - 
getTempFilePrefixpublic String getTempFilePrefix() 
 - 
isEnableUnsecureFeaturespublic boolean isEnableUnsecureFeatures() 
 - 
setEnableUnsecureFeaturespublic void setEnableUnsecureFeatures(boolean enableUnsecureFeatures) 
 - 
getHostpublic String getHost() 
 - 
setHostpublic void setHost(String host) 
 - 
getLogLevelpublic String getLogLevel() 
 - 
setLogLevelpublic void setLogLevel(String level) throws TikaConfigException - Throws:
- TikaConfigException
 
 - 
getCorspublic String getCors() - Returns:
- the origin url for cors, can be "*"
 
 - 
setCorspublic void setCors(String cors) 
 - 
hasConfigFilepublic boolean hasConfigFile() 
 - 
getConfigPathpublic Path getConfigPath() 
 - 
setConfigPathpublic void setConfigPath(String path) 
 - 
getDigestMarkLimitpublic int getDigestMarkLimit() 
 - 
setDigestMarkLimitpublic void setDigestMarkLimit(int digestMarkLimit) 
 - 
getDigestpublic String 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:
 
 - 
setDigestpublic void setDigest(String digest) 
 - 
getMaxFilespublic long getMaxFiles() maximum number of files before the forked server restarts. This is useful for avoiding any slow-building memory leaks/bloat.- Returns:
 
 - 
setMaxFilespublic void setMaxFiles(long maxFiles) 
 - 
isReturnStackTracepublic boolean isReturnStackTrace() 
 - 
setReturnStackTracepublic void setReturnStackTrace(boolean returnStackTrace) 
 - 
setTlsConfigpublic void setTlsConfig(TlsConfig tlsConfig) 
 - 
getTlsConfigpublic TlsConfig getTlsConfig() 
 - 
getIdpublic String getId() 
 - 
setIdpublic void setId(String id) 
 - 
getNumRestartspublic int getNumRestarts() 
 - 
getForkedStatusFilepublic String getForkedStatusFile() 
 - 
setMaxforkedStartupMillispublic void setMaxforkedStartupMillis(long maxforkedStartupMillis) 
 - 
setPreventStopMethodpublic void setPreventStopMethod(boolean preventStopMethod) 
 - 
isPreventStopMethodpublic boolean isPreventStopMethod() 
 - 
getPortspublic int[] getPorts() 
 
- 
 
-