Package org.apache.tika.server.core
Class TikaServerConfig
java.lang.Object
org.apache.tika.server.core.TikaServerConfig
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final longHow long a full /async queue blocks a POST before it is rejected with 429.static final longDefault request-body cap: 1 GiB.static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCors()getHost()getId()Identifier for this server, surfaced in the startup log.longHow long a POST to /async blocks when the queue is full before it is rejected with 429 (Retry-After); defaults toDEFAULT_MAX_QUEUE_PAUSE_MILLIS.longMaximum request body in bytes; defaults toDEFAULT_MAX_REQUEST_SIZE_BYTES(1 GiB). tika-server spools uploads to disk, so this bounds how much one request can write.intgetPort()Severity at which each request URI is logged.booleanbooleanWhether callers may supply per-request parser configuration (the/configendpoints and the multipartconfigpart).booleanWhether the pipes/fetch endpoints (pipes,async) may be enabled.static TikaServerConfigload()Config with only the defaultsstatic TikaServerConfigload(org.apache.commons.cli.CommandLine commandLine) voidsetAllowPerRequestConfig(boolean allowPerRequestConfig) voidsetAllowPipes(boolean allowPipes) voidsetConfigPath(String path) Set from the -c argument at load time; not a user-settable config key.voidvoidsetEndpoints(ArrayList<String> endpoints) voidvoidvoidsetMaxQueuePauseMillis(long maxQueuePauseMillis) voidsetMaxRequestSizeBytes(long maxRequestSizeBytes) voidsetPort(int port) voidsetRequestLogLevel(String level) voidsetTlsConfig(TlsConfig tlsConfig)
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_HOST
- See Also:
-
DEFAULT_MAX_REQUEST_SIZE_BYTES
public static final long DEFAULT_MAX_REQUEST_SIZE_BYTESDefault request-body cap: 1 GiB. Generous enough for essentially any single-document upload, bounded so one request cannot fill the temp directory. Operators who genuinely need larger bodies raise it explicitly; setting a negative value restores no limit.- See Also:
-
DEFAULT_MAX_QUEUE_PAUSE_MILLIS
public static final long DEFAULT_MAX_QUEUE_PAUSE_MILLISHow long a full /async queue blocks a POST before it is rejected with 429.- 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:
IOExceptionTikaException
-
getPort
public int getPort() -
setPort
public void setPort(int port) -
isAllowPipes
public boolean isAllowPipes()Whether the pipes/fetch endpoints (pipes,async) may be enabled. Off by default; selecting one of those endpoints without this set causes the server to refuse to start. -
setAllowPipes
public void setAllowPipes(boolean allowPipes) -
isAllowPerRequestConfig
public boolean isAllowPerRequestConfig()Whether callers may supply per-request parser configuration (the/configendpoints and the multipartconfigpart). Off by default; when off, such requests are rejected with 403. -
setAllowPerRequestConfig
public void setAllowPerRequestConfig(boolean allowPerRequestConfig) -
getHost
-
setHost
-
getRequestLogLevel
Severity at which each request URI is logged. Empty (the default) disables request logging entirely; this does not change the log level of anything else. -
setRequestLogLevel
- Throws:
TikaConfigException
-
getCors
- Returns:
- the origin url for cors, can be "*"
-
setCors
-
hasConfigFile
public boolean hasConfigFile() -
getConfigPath
-
setConfigPath
Set from the -c argument at load time; not a user-settable config key. -
getMaxRequestSizeBytes
public long getMaxRequestSizeBytes()Maximum request body in bytes; defaults toDEFAULT_MAX_REQUEST_SIZE_BYTES(1 GiB). tika-server spools uploads to disk, so this bounds how much one request can write. A negative value disables the limit (the pre-4.0 behavior); an over-limit request is rejected with 413. -
setMaxRequestSizeBytes
public void setMaxRequestSizeBytes(long maxRequestSizeBytes) -
getMaxQueuePauseMillis
public long getMaxQueuePauseMillis()How long a POST to /async blocks when the queue is full before it is rejected with 429 (Retry-After); defaults toDEFAULT_MAX_QUEUE_PAUSE_MILLIS. -
setMaxQueuePauseMillis
public void setMaxQueuePauseMillis(long maxQueuePauseMillis) -
getTlsConfig
-
setTlsConfig
-
getEndpoints
-
setEndpoints
-
getId
Identifier for this server, surfaced in the startup log. Defaults to a random UUID. -
setId
-