rename static variables to all caps
@@ -93,10 +93,10 @@ public class TikaResource {
private static final String META_PREFIX = "meta_";
private static final Logger LOG = LoggerFactory.getLogger(TikaResource.class);
private static Pattern ALLOWABLE_HEADER_CHARS = Pattern.compile("(?i)^[-/_+\\.A-Z0-9 ]+$");
- private static TikaConfig tikaConfig;
- private static TikaServerConfig tikaServerConfig;
- private static DigestingParser.Digester digester = null;
- private static InputStreamFactory inputStreamFactory = null;
+ private static TikaConfig TIKA_CONFIG;
+ private static TikaServerConfig TIKA_SERVER_CONFIG;
+ private static DigestingParser.Digester DIGESTER = null;
+ private static InputStreamFactory INPUTSTREAM_FACTORY = null;
private static ServerStatus SERVER_STATUS = null;
private static ParseContextConfig PARSE_CONTEXT_CONFIG = new CompositeParseContextConfig();
@@ -105,26 +105,26 @@ public class TikaResource {
public static void init(TikaConfig config, TikaServerConfig tikaServerConfg,
DigestingParser.Digester digestr,
InputStreamFactory iSF, ServerStatus serverStatus) {
- tikaConfig = config;
- tikaServerConfig = tikaServerConfg;
- digester = digestr;
- inputStreamFactory = iSF;
+ TIKA_CONFIG = config;
+ TIKA_SERVER_CONFIG = tikaServerConfg;
+ DIGESTER = digestr;
+ INPUTSTREAM_FACTORY = iSF;
SERVER_STATUS = serverStatus;
}
@SuppressWarnings("serial")
public static Parser createParser() {
- final Parser parser = new AutoDetectParser(tikaConfig);
+ final Parser parser = new AutoDetectParser(TIKA_CONFIG);
- if (digester != null) {
- return new DigestingParser(parser, digester);
+ if (DIGESTER != null) {
+ return new DigestingParser(parser, DIGESTER);
}
return parser;
}
public static TikaConfig getConfig() {
- return tikaConfig;
+ return TIKA_CONFIG;
}
public static String detectFilename(MultivaluedMap<String, String> httpHeaders) {
@@ -154,7 +154,7 @@ public class TikaResource {
public static InputStream getInputStream(InputStream is, Metadata metadata,
HttpHeaders headers) {
try {
- return inputStreamFactory.getInputStream(is, metadata, headers);
+ return INPUTSTREAM_FACTORY.getInputStream(is, metadata, headers);
} catch (IOException e) {
throw new TikaServerParseException(e);
}
@@ -576,7 +576,7 @@ public class TikaResource {
metadata.set(TikaCoreProperties.WRITE_LIMIT_REACHED, "true");
writeLimitReached = true;
}
- if (tikaServerConfig.isReturnStackTrace()) {
+ if (TIKA_SERVER_CONFIG.isReturnStackTrace()) {
if (cause != null) {
metadata.add(TikaCoreProperties.CONTAINER_EXCEPTION,
ExceptionUtils.getStackTrace(cause));
@@ -588,7 +588,7 @@ public class TikaResource {
throw e;
}
} catch (OutOfMemoryError e) {
- if (tikaServerConfig.isReturnStackTrace()) {
+ if (TIKA_SERVER_CONFIG.isReturnStackTrace()) {
metadata.add(TikaCoreProperties.CONTAINER_EXCEPTION,
ExceptionUtils.getStackTrace(e));
} else {
