You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ti...@apache.org on 2024/02/24 15:40:00 UTC
(tika) 01/03: TIKA-4203: add @Deprecated annotation
This is an automated email from the ASF dual-hosted git repository.
tilman pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
commit 297fcd187c186147423ced3a3a25fe01c42e02a2
Author: Tilman Hausherr <ti...@apache.org>
AuthorDate: Sat Feb 24 16:35:12 2024 +0100
TIKA-4203: add @Deprecated annotation
---
tika-core/src/main/java/org/apache/tika/metadata/IPTC.java | 8 ++++++++
tika-core/src/main/java/org/apache/tika/mime/MimeTypes.java | 4 +++-
.../src/main/java/org/apache/tika/parser/AbstractParser.java | 1 +
.../src/main/java/org/apache/tika/parser/ParserDecorator.java | 1 +
.../org/apache/tika/parser/multiple/AbstractMultipleParser.java | 1 +
5 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/tika-core/src/main/java/org/apache/tika/metadata/IPTC.java b/tika-core/src/main/java/org/apache/tika/metadata/IPTC.java
index d20f45038..f5fa6442b 100644
--- a/tika-core/src/main/java/org/apache/tika/metadata/IPTC.java
+++ b/tika-core/src/main/java/org/apache/tika/metadata/IPTC.java
@@ -506,6 +506,7 @@ public interface IPTC {
*
* @deprecated
*/
+ @Deprecated
Property URGENCY = Photoshop.URGENCY;
/**
@@ -518,6 +519,7 @@ public interface IPTC {
*
* @deprecated
*/
+ @Deprecated
Property CATEGORY = Photoshop.CATEGORY;
/**
@@ -528,6 +530,7 @@ public interface IPTC {
*
* @deprecated
*/
+ @Deprecated
Property SUPPLEMENTAL_CATEGORIES = Photoshop.SUPPLEMENTAL_CATEGORIES;
/**
@@ -638,6 +641,7 @@ public interface IPTC {
*
* @deprecated
*/
+ @Deprecated
Property DIGITAL_SOURCE_FILE_TYPE = Property.internalText(
PREFIX_IPTC_EXT + TikaCoreProperties.NAMESPACE_PREFIX_DELIMITER +
"DigitalSourcefileType");
@@ -690,6 +694,7 @@ public interface IPTC {
/**
* @deprecated use {@link IPTC#IMAGE_SUPPLIER_ID}
*/
+ @Deprecated
String IMAGE_SUPPLIER_ID_WRONG_CASE =
PREFIX_PLUS + TikaCoreProperties.NAMESPACE_PREFIX_DELIMITER + "ImageSupplierId";
/**
@@ -796,6 +801,7 @@ public interface IPTC {
/**
* @deprecated use {@link IPTC#COPYRIGHT_OWNER_ID}
*/
+ @Deprecated
String COPYRIGHT_OWNER_ID_WRONG_CASE =
PREFIX_PLUS + TikaCoreProperties.NAMESPACE_PREFIX_DELIMITER + "CopyrightOwnerId";
/**
@@ -839,6 +845,7 @@ public interface IPTC {
/**
* @deprecated use {@link IPTC#IMAGE_CREATOR_ID}
*/
+ @Deprecated
String IMAGE_CREATOR_ID_WRONG_CASE =
PREFIX_PLUS + TikaCoreProperties.NAMESPACE_PREFIX_DELIMITER + "ImageCreatorId";
/**
@@ -883,6 +890,7 @@ public interface IPTC {
/**
* @deprecated use {@link IPTC#LICENSOR_ID}
*/
+ @Deprecated
String LICENSOR_ID_WRONG_CASE =
PREFIX_PLUS + TikaCoreProperties.NAMESPACE_PREFIX_DELIMITER + "LicensorId";
/**
diff --git a/tika-core/src/main/java/org/apache/tika/mime/MimeTypes.java b/tika-core/src/main/java/org/apache/tika/mime/MimeTypes.java
index 40e4d33af..10ef6cbc7 100644
--- a/tika-core/src/main/java/org/apache/tika/mime/MimeTypes.java
+++ b/tika-core/src/main/java/org/apache/tika/mime/MimeTypes.java
@@ -177,6 +177,7 @@ public final class MimeTypes implements Detector, Serializable {
* @return the Mime Content Type of the specified document name
* @deprecated Use {@link Tika#detect(String)} instead
*/
+ @Deprecated
public MimeType getMimeType(String name) {
MimeType type = patterns.matches(name);
if (type != null) {
@@ -200,6 +201,7 @@ public final class MimeTypes implements Detector, Serializable {
* @throws IOException if the file can't be read
* @deprecated Use {@link Tika#detect(File)} instead
*/
+ @Deprecated
public MimeType getMimeType(File file) throws MimeTypeException, IOException {
return forName(new Tika(this).detect(file));
}
@@ -369,7 +371,7 @@ public final class MimeTypes implements Detector, Serializable {
/**
* Returns the registered, normalised media type with the given name (or alias).
*
- * <p>Unlike {@link #forName(String)}, this function will <em>not<em> create a
+ * <p>Unlike {@link #forName(String)}, this function will <em>not</em> create a
* new MimeType and register it. Instead, <code>null</code> will be returned if
* there is no definition available for the given name.
*
diff --git a/tika-core/src/main/java/org/apache/tika/parser/AbstractParser.java b/tika-core/src/main/java/org/apache/tika/parser/AbstractParser.java
index ebd37a3d3..f6017d6c0 100644
--- a/tika-core/src/main/java/org/apache/tika/parser/AbstractParser.java
+++ b/tika-core/src/main/java/org/apache/tika/parser/AbstractParser.java
@@ -51,6 +51,7 @@ public abstract class AbstractParser implements Parser {
* @deprecated use the {@link Parser#parse(InputStream, ContentHandler,
* Metadata, ParseContext)} method instead
*/
+ @Deprecated
public void parse(InputStream stream, ContentHandler handler, Metadata metadata)
throws IOException, SAXException, TikaException {
parse(stream, handler, metadata, new ParseContext());
diff --git a/tika-core/src/main/java/org/apache/tika/parser/ParserDecorator.java b/tika-core/src/main/java/org/apache/tika/parser/ParserDecorator.java
index 587277aad..32d6661fb 100644
--- a/tika-core/src/main/java/org/apache/tika/parser/ParserDecorator.java
+++ b/tika-core/src/main/java/org/apache/tika/parser/ParserDecorator.java
@@ -120,6 +120,7 @@ public class ParserDecorator implements Parser {
*
* @deprecated This has been replaced by {@link FallbackParser}
*/
+ @Deprecated
public static final Parser withFallbacks(final Collection<? extends Parser> parsers,
final Set<MediaType> types) {
// Delegate to the new FallbackParser for now, until people upgrade
diff --git a/tika-core/src/main/java/org/apache/tika/parser/multiple/AbstractMultipleParser.java b/tika-core/src/main/java/org/apache/tika/parser/multiple/AbstractMultipleParser.java
index e1dd2baac..9f2ea8a3b 100644
--- a/tika-core/src/main/java/org/apache/tika/parser/multiple/AbstractMultipleParser.java
+++ b/tika-core/src/main/java/org/apache/tika/parser/multiple/AbstractMultipleParser.java
@@ -252,6 +252,7 @@ public abstract class AbstractMultipleParser implements Parser {
* @deprecated The {@link ContentHandlerFactory} override is still experimental
* and the method signature is subject to change before Tika 2.0
*/
+ @Deprecated
public void parse(InputStream stream, ContentHandlerFactory handlers, Metadata metadata,
ParseContext context) throws IOException, SAXException, TikaException {
parse(stream, null, handlers, metadata, context);