Class TikaServerConfig

java.lang.Object
org.apache.tika.server.core.TikaServerConfig

public class TikaServerConfig extends Object
  • Field Details

    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      See Also:
    • DEFAULT_HOST

      public static final String DEFAULT_HOST
      See Also:
    • DEFAULT_MAX_REQUEST_SIZE_BYTES

      public static final long DEFAULT_MAX_REQUEST_SIZE_BYTES
      Default 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_MILLIS
      How long a full /async queue blocks a POST before it is rejected with 429.
      See Also:
  • Constructor Details

    • TikaServerConfig

      public TikaServerConfig()
  • Method Details

    • load

      public static TikaServerConfig load()
      Config with only the defaults
    • load

      public static TikaServerConfig load(org.apache.commons.cli.CommandLine commandLine) throws IOException, TikaException
      Throws:
      IOException
      TikaException
    • 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 /config endpoints and the multipart config part). Off by default; when off, such requests are rejected with 403.
    • setAllowPerRequestConfig

      public void setAllowPerRequestConfig(boolean allowPerRequestConfig)
    • getHost

      public String getHost()
    • setHost

      public void setHost(String host)
    • getRequestLogLevel

      public String 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

      public void setRequestLogLevel(String level) throws TikaConfigException
      Throws:
      TikaConfigException
    • getCors

      public String getCors()
      Returns:
      the origin url for cors, can be "*"
    • setCors

      public void setCors(String cors)
    • hasConfigFile

      public boolean hasConfigFile()
    • getConfigPath

      public Path getConfigPath()
    • setConfigPath

      public void setConfigPath(String path)
      Set from the -c argument at load time; not a user-settable config key.
    • getMaxRequestSizeBytes

      public long getMaxRequestSizeBytes()
      Maximum request body in bytes; defaults to DEFAULT_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 to DEFAULT_MAX_QUEUE_PAUSE_MILLIS.
    • setMaxQueuePauseMillis

      public void setMaxQueuePauseMillis(long maxQueuePauseMillis)
    • getTlsConfig

      public TlsConfig getTlsConfig()
    • setTlsConfig

      public void setTlsConfig(TlsConfig tlsConfig)
    • getEndpoints

      public ArrayList<String> getEndpoints()
    • setEndpoints

      public void setEndpoints(ArrayList<String> endpoints)
    • getId

      public String getId()
      Identifier for this server, surfaced in the startup log. Defaults to a random UUID.
    • setId

      public void setId(String id)