Class TikaServerConfig

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

public class TikaServerConfig extends ConfigBase
  • Field Details

    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      See Also:
    • DEFAULT_HOST

      public static final String DEFAULT_HOST
      See Also:
    • LOG_LEVELS

      public static final Set<String> LOG_LEVELS
    • DEFAULT_TASK_TIMEOUT_MILLIS

      public 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:
    • DEFAULT_MINIMUM_TIMEOUT_MILLIS

      public 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:
    • DEFAULT_TASK_PULSE_MILLIS

      public static final long DEFAULT_TASK_PULSE_MILLIS
      How 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_MILLIS
      Number of milliseconds to wait for forked process to startup
      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
    • interpolateSysProps

      protected static List<String> interpolateSysProps(List<String> forkedJvmArgs)
    • isNoFork

      public boolean isNoFork()
    • setNoFork

      public void setNoFork(boolean noFork)
    • getPort

      public String getPort()
    • setPort

      public void setPort(String port)
    • 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

      public List<String> getForkedProcessArgs(String portString, String id)
    • getForkedProcessArgs

      public List<String> getForkedProcessArgs(int port, String id)
    • getMinimumTimeoutMillis

      public long getMinimumTimeoutMillis()
    • setMinimumTimeoutMillis

      public void setMinimumTimeoutMillis(long minimumTimeoutMillis)
    • getIdBase

      public String getIdBase()
    • getJavaPath

      public String getJavaPath()
      full path to the java executable
      Returns:
    • setJavaPath

      public void setJavaPath(String javaPath)
    • getForkedJvmArgs

      public List<String> getForkedJvmArgs()
    • setForkedJvmArgs

      public void setForkedJvmArgs(List<String> forkedJvmArgs)
    • getTempFilePrefix

      public String getTempFilePrefix()
    • isEnableUnsecureFeatures

      public boolean isEnableUnsecureFeatures()
    • setEnableUnsecureFeatures

      public void setEnableUnsecureFeatures(boolean enableUnsecureFeatures)
    • getHost

      public String getHost()
    • setHost

      public void setHost(String host)
    • getLogLevel

      public String getLogLevel()
    • setLogLevel

      public void setLogLevel(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)
    • getDigestMarkLimit

      public int getDigestMarkLimit()
    • setDigestMarkLimit

      public void setDigestMarkLimit(int digestMarkLimit)
    • getDigest

      public 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:
    • setDigest

      public void setDigest(String digest)
    • 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

      public TlsConfig getTlsConfig()
    • setTlsConfig

      public void setTlsConfig(TlsConfig tlsConfig)
    • getEndpoints

      public List<String> getEndpoints()
    • setEndpoints

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

      public String getId()
    • setId

      public void setId(String id)
    • getNumRestarts

      public int getNumRestarts()
    • getForkedStatusFile

      public String getForkedStatusFile()
    • setMaxforkedStartupMillis

      public void setMaxforkedStartupMillis(long maxforkedStartupMillis)
    • isPreventStopMethod

      public boolean isPreventStopMethod()
    • setPreventStopMethod

      public void setPreventStopMethod(boolean preventStopMethod)
    • getPorts

      public int[] getPorts()
    • getSupportedFetchers

      public Set<String> getSupportedFetchers()
    • getSupportedEmitters

      public Set<String> getSupportedEmitters()