Author: jukka
Date: Mon Sep 24 09:36:47 2007
New Revision: 578873
URL: http://svn.apache.org/viewvc?rev=578873&view=rev
Log:
TIKA-17 - Rename all "Luis" classes to be "Tika" classes
Added:
incubator/tika/trunk/src/main/java/org/apache/tika/config/TikaConfig.java
- copied, changed from r578871,
incubator/tika/trunk/src/main/java/org/apache/tika/config/LiusConfig.java
incubator/tika/trunk/src/main/java/org/apache/tika/exception/TikaException.java
- copied, changed from r578863,
incubator/tika/trunk/src/main/java/org/apache/tika/exception/LiusException.java
incubator/tika/trunk/src/main/java/org/apache/tika/log/TikaLogger.java
- copied, changed from r578863,
incubator/tika/trunk/src/main/java/org/apache/tika/log/LiusLogger.java
Removed:
incubator/tika/trunk/src/main/java/org/apache/tika/config/LiusConfig.java
incubator/tika/trunk/src/main/java/org/apache/tika/exception/LiusException.java
incubator/tika/trunk/src/main/java/org/apache/tika/log/LiusLogger.java
Modified:
incubator/tika/trunk/CHANGES.txt
incubator/tika/trunk/src/main/java/org/apache/tika/parser/ParserFactory.java
incubator/tika/trunk/src/main/java/org/apache/tika/utils/ParseUtils.java
incubator/tika/trunk/src/test/java/org/apache/tika/TestParsers.java
Modified: incubator/tika/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/tika/trunk/CHANGES.txt?rev=578873&r1=578872&r2=578873&view=diff
==============================================================================
--- incubator/tika/trunk/CHANGES.txt (original)
+++ incubator/tika/trunk/CHANGES.txt Mon Sep 24 09:36:47 2007
@@ -38,3 +38,5 @@
17. TIKA-22 - Remove @author tags from the java source (mattmann)
18. TIKA-21 - Simplified configuration code (jukka)
+
+19. TIKA-17 - Rename all "Luis" classes to be "Tika" classes (jukka)
Copied:
incubator/tika/trunk/src/main/java/org/apache/tika/config/TikaConfig.java (from
r578871,
incubator/tika/trunk/src/main/java/org/apache/tika/config/LiusConfig.java)
URL:
http://svn.apache.org/viewvc/incubator/tika/trunk/src/main/java/org/apache/tika/config/TikaConfig.java?p2=incubator/tika/trunk/src/main/java/org/apache/tika/config/TikaConfig.java&p1=incubator/tika/trunk/src/main/java/org/apache/tika/config/LiusConfig.java&r1=578871&r2=578873&rev=578873&view=diff
==============================================================================
--- incubator/tika/trunk/src/main/java/org/apache/tika/config/LiusConfig.java
(original)
+++ incubator/tika/trunk/src/main/java/org/apache/tika/config/TikaConfig.java
Mon Sep 24 09:36:47 2007
@@ -30,12 +30,12 @@
/**
* Parse xml config file.
*/
-public class LiusConfig {
+public class TikaConfig {
private final Map<String, ParserConfig> configs =
new HashMap<String, ParserConfig>();
- public LiusConfig(String file) throws JDOMException, IOException {
+ public TikaConfig(String file) throws JDOMException, IOException {
Document document = new SAXBuilder().build(new File(file));
for (Object element : XPath.selectNodes(document, "//parser")) {
ParserConfig pc = new ParserConfig((Element) element);
Copied:
incubator/tika/trunk/src/main/java/org/apache/tika/exception/TikaException.java
(from r578863,
incubator/tika/trunk/src/main/java/org/apache/tika/exception/LiusException.java)
URL:
http://svn.apache.org/viewvc/incubator/tika/trunk/src/main/java/org/apache/tika/exception/TikaException.java?p2=incubator/tika/trunk/src/main/java/org/apache/tika/exception/TikaException.java&p1=incubator/tika/trunk/src/main/java/org/apache/tika/exception/LiusException.java&r1=578863&r2=578873&rev=578873&view=diff
==============================================================================
---
incubator/tika/trunk/src/main/java/org/apache/tika/exception/LiusException.java
(original)
+++
incubator/tika/trunk/src/main/java/org/apache/tika/exception/TikaException.java
Mon Sep 24 09:36:47 2007
@@ -20,9 +20,9 @@
* Lius exception
*
*/
-public class LiusException extends Exception {
+public class TikaException extends Exception {
- public LiusException(String msg) {
+ public TikaException(String msg) {
super(msg);
}
Copied: incubator/tika/trunk/src/main/java/org/apache/tika/log/TikaLogger.java
(from r578863,
incubator/tika/trunk/src/main/java/org/apache/tika/log/LiusLogger.java)
URL:
http://svn.apache.org/viewvc/incubator/tika/trunk/src/main/java/org/apache/tika/log/TikaLogger.java?p2=incubator/tika/trunk/src/main/java/org/apache/tika/log/TikaLogger.java&p1=incubator/tika/trunk/src/main/java/org/apache/tika/log/LiusLogger.java&r1=578863&r2=578873&rev=578873&view=diff
==============================================================================
--- incubator/tika/trunk/src/main/java/org/apache/tika/log/LiusLogger.java
(original)
+++ incubator/tika/trunk/src/main/java/org/apache/tika/log/TikaLogger.java Mon
Sep 24 09:36:47 2007
@@ -24,7 +24,7 @@
* Lius Logger
*
*/
-public class LiusLogger {
+public class TikaLogger {
static Logger logger = Logger.getLogger("TikaLogger");
public static void setLoggerConfigFile(String loggerConfigPath) {
Modified:
incubator/tika/trunk/src/main/java/org/apache/tika/parser/ParserFactory.java
URL:
http://svn.apache.org/viewvc/incubator/tika/trunk/src/main/java/org/apache/tika/parser/ParserFactory.java?rev=578873&r1=578872&r2=578873&view=diff
==============================================================================
---
incubator/tika/trunk/src/main/java/org/apache/tika/parser/ParserFactory.java
(original)
+++
incubator/tika/trunk/src/main/java/org/apache/tika/parser/ParserFactory.java
Mon Sep 24 09:36:47 2007
@@ -20,9 +20,9 @@
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import org.apache.tika.config.LiusConfig;
+import org.apache.tika.config.TikaConfig;
import org.apache.tika.config.ParserConfig;
-import org.apache.tika.exception.LiusException;
+import org.apache.tika.exception.TikaException;
/**
* Factory class. Build parser from xml config file.
@@ -36,26 +36,26 @@
public static Parser getParser(
- InputStream inputStream, String mimeType, LiusConfig tc)
- throws LiusException {
+ InputStream inputStream, String mimeType, TikaConfig tc)
+ throws TikaException {
// Verify that all passed parameters are (probably) valid.
if (StringUtils.isBlank(mimeType)) {
- throw new LiusException("Mime type not specified.");
+ throw new TikaException("Mime type not specified.");
}
if (inputStream == null) {
- throw new LiusException("Input stream is null.");
+ throw new TikaException("Input stream is null.");
}
if (tc == null) {
- throw new LiusException("Configuration object is null.");
+ throw new TikaException("Configuration object is null.");
}
ParserConfig pc = getParserConfig(mimeType, tc);
if (pc == null) {
- throw new LiusException(
+ throw new TikaException(
"Could not find parser config for mime type "
+ mimeType + ".");
}
@@ -64,7 +64,7 @@
Parser parser = null;
if (StringUtils.isBlank(className)) {
- throw new LiusException(
+ throw new TikaException(
"Parser class name missing from ParserConfig.");
}
@@ -80,21 +80,21 @@
} catch (ClassNotFoundException e) {
logger.error(e.getMessage());
- throw new LiusException(e.getMessage());
+ throw new TikaException(e.getMessage());
} catch (InstantiationException e) {
logger.error(e.getMessage());
- throw new LiusException(e.getMessage());
+ throw new TikaException(e.getMessage());
} catch (IllegalAccessException e) {
logger.error(e.getMessage());
- throw new LiusException(e.getMessage());
+ throw new TikaException(e.getMessage());
}
return parser;
}
- private static ParserConfig getParserConfig(String mimeType, LiusConfig tc)
- throws LiusException {
+ private static ParserConfig getParserConfig(String mimeType, TikaConfig tc)
+ throws TikaException {
ParserConfig pc = tc.getParserConfig(mimeType);
@@ -104,7 +104,7 @@
+ mimeType + ".";
logger.error(message);
- throw new LiusException(message);
+ throw new TikaException(message);
}
return pc;
Modified:
incubator/tika/trunk/src/main/java/org/apache/tika/utils/ParseUtils.java
URL:
http://svn.apache.org/viewvc/incubator/tika/trunk/src/main/java/org/apache/tika/utils/ParseUtils.java?rev=578873&r1=578872&r2=578873&view=diff
==============================================================================
--- incubator/tika/trunk/src/main/java/org/apache/tika/utils/ParseUtils.java
(original)
+++ incubator/tika/trunk/src/main/java/org/apache/tika/utils/ParseUtils.java
Mon Sep 24 09:36:47 2007
@@ -24,8 +24,8 @@
import java.net.URL;
// TIKA imports
-import org.apache.tika.config.LiusConfig;
-import org.apache.tika.exception.LiusException;
+import org.apache.tika.config.TikaConfig;
+import org.apache.tika.exception.TikaException;
import org.apache.tika.metadata.TikaMimeKeys;
import org.apache.tika.mime.MimeUtils;
import org.apache.tika.parser.Parser;
@@ -57,14 +57,14 @@
* the document's MIME type
* @return a parser appropriate to this MIME type and ready to read input
* from the specified document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static Parser getParser(InputStream inputStream, LiusConfig config,
- String mimeType) throws LiusException, IOException {
+ public static Parser getParser(InputStream inputStream, TikaConfig config,
+ String mimeType) throws TikaException, IOException {
if (inputStream == null) {
- throw new LiusException("Document input stream not provided.");
+ throw new TikaException("Document input stream not provided.");
}
return ParserFactory.getParser(inputStream, mimeType, config);
@@ -86,14 +86,14 @@
* the document's MIME type
* @return a parser appropriate to this MIME type and ready to read input
* from the specified document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static Parser getParser(URL documentUrl, LiusConfig config,
- String mimeType) throws LiusException, IOException {
+ public static Parser getParser(URL documentUrl, TikaConfig config,
+ String mimeType) throws TikaException, IOException {
if (documentUrl == null) {
- throw new LiusException("Document URL not provided.");
+ throw new TikaException("Document URL not provided.");
}
return ParserFactory.getParser(documentUrl.openStream(), mimeType,
@@ -111,11 +111,11 @@
* @param config
* @return a parser appropriate to this MIME type and ready to read input
* from the specified document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static Parser getParser(URL documentUrl, LiusConfig config)
- throws LiusException, IOException {
+ public static Parser getParser(URL documentUrl, TikaConfig config)
+ throws TikaException, IOException {
String mimetype = mimeUtils.getRepository().getMimeType(documentUrl)
.getName();
@@ -134,18 +134,18 @@
* the document's MIME type
* @return a parser appropriate to this MIME type and ready to read input
* from the specified document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static Parser getParser(File documentFile, LiusConfig config,
- String mimeType) throws LiusException, IOException {
+ public static Parser getParser(File documentFile, TikaConfig config,
+ String mimeType) throws TikaException, IOException {
if (documentFile == null) {
- throw new LiusException("Document file not provided.");
+ throw new TikaException("Document file not provided.");
}
if (!documentFile.canRead()) {
- throw new LiusException(
+ throw new TikaException(
"Document file does not exist or is not readable.");
}
@@ -166,11 +166,11 @@
* @param config
* @return a parser appropriate to this MIME type and ready to read input
* from the specified document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static Parser getParser(File documentFile, LiusConfig config)
- throws LiusException, IOException {
+ public static Parser getParser(File documentFile, TikaConfig config)
+ throws TikaException, IOException {
String mimetype = mimeUtils.getRepository().getMimeType(documentFile)
.getName();
@@ -186,11 +186,11 @@
* @param mimeType
* MIME type of the data
* @return the string content parsed from the document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
public static String getStringContent(InputStream inputStream,
- LiusConfig config, String mimeType) throws LiusException,
+ TikaConfig config, String mimeType) throws TikaException,
IOException {
Parser parser = getParser(inputStream, config, mimeType);
@@ -204,11 +204,11 @@
* URL pointing to the document to parse
* @param config
* @return the string content parsed from the document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static String getStringContent(URL documentUrl, LiusConfig config)
- throws LiusException, IOException {
+ public static String getStringContent(URL documentUrl, TikaConfig config)
+ throws TikaException, IOException {
Parser parser = getParser(documentUrl, config);
return getStringContent(parser);
@@ -223,11 +223,11 @@
* @param mimeType
* MIME type of the data
* @return the string content parsed from the document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static String getStringContent(URL documentUrl, LiusConfig config,
- String mimeType) throws LiusException, IOException {
+ public static String getStringContent(URL documentUrl, TikaConfig config,
+ String mimeType) throws TikaException, IOException {
Parser parser = getParser(documentUrl, config, mimeType);
return getStringContent(parser);
@@ -242,11 +242,11 @@
* @param mimeType
* MIME type of the data
* @return the string content parsed from the document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static String getStringContent(File documentFile, LiusConfig config,
- String mimeType) throws LiusException, IOException {
+ public static String getStringContent(File documentFile, TikaConfig config,
+ String mimeType) throws TikaException, IOException {
Parser parser = getParser(documentFile, config, mimeType);
return getStringContent(parser);
@@ -259,11 +259,11 @@
* File object pointing to the document to parse
* @param config
* @return the string content parsed from the document
- * @throws LiusException
+ * @throws TikaException
* @throws IOException
*/
- public static String getStringContent(File documentFile, LiusConfig config)
- throws LiusException, IOException {
+ public static String getStringContent(File documentFile, TikaConfig config)
+ throws TikaException, IOException {
Parser parser = getParser(documentFile, config);
return getStringContent(parser);
Modified: incubator/tika/trunk/src/test/java/org/apache/tika/TestParsers.java
URL:
http://svn.apache.org/viewvc/incubator/tika/trunk/src/test/java/org/apache/tika/TestParsers.java?rev=578873&r1=578872&r2=578873&view=diff
==============================================================================
--- incubator/tika/trunk/src/test/java/org/apache/tika/TestParsers.java
(original)
+++ incubator/tika/trunk/src/test/java/org/apache/tika/TestParsers.java Mon Sep
24 09:36:47 2007
@@ -20,8 +20,8 @@
import java.io.IOException;
import org.apache.tika.config.Content;
-import org.apache.tika.config.LiusConfig;
-import org.apache.tika.log.LiusLogger;
+import org.apache.tika.config.TikaConfig;
+import org.apache.tika.log.TikaLogger;
import org.apache.tika.parser.Parser;
import org.apache.tika.utils.ParseUtils;
import org.apache.tika.utils.Utils;
@@ -34,7 +34,7 @@
*/
public class TestParsers extends TestCase {
- private LiusConfig tc;
+ private TikaConfig tc;
private File testFilesBaseDir;
public void setUp() throws JDOMException, IOException {
@@ -59,9 +59,9 @@
final String log4jPropertiesFilename =
"target/classes/log4j/log4j.properties";
testFilesBaseDir = new File("src/test/resources/test-documents");
- tc = new LiusConfig(liusConfigFilename);
+ tc = new TikaConfig(liusConfigFilename);
- LiusLogger.setLoggerConfigFile(log4jPropertiesFilename);
+ TikaLogger.setLoggerConfigFile(log4jPropertiesFilename);
}