10

In the third of my deployer extension queries this week(!) I've noticed that several methods are flagged as deprecated.

Checking the API docs confirms this:

Deprecated. The transportPackage is internal API, do not use

But this applies to key classes like com.tridion.transport.transportpackage.Page which is part of the processPage method I'm overriding:

protected void processPage(Page page, java.io.File pageFile) throws ProcessingException

Apparently I can suppress this warning:

@SuppressWarnings("deprecation")

Is it safe to do so then?

It seems odd that the method the documentation tells you to override should expose a deprecated class?

  • 1
    The @deprecation annotation on a method is purely informational. The only result is that the compiler writes out the warning you are seeing when that method is used. Suppressing the deprecation warnings only means that the compiler will no longer write the warning. So it is completely safe, but it does not change anything about the status of the method. – Frank van Puffelen Apr 6 '13 at 23:58
7

I encountered the same issue before when upgrading a deployer extension (for 2011) and queried the deprecated status with those "in the know".

The answer I saw was that the TransportPackage was marked as deprecated as of 2009, as it is intended to be replaced with a more solid alternative in future releases.

Given that we use these classes in our own API and documentation I think it's safe to continue to use them right now. Looking quickly at the documentation for 2013, that also uses the TransportPackage classes in the same way.

I would choose not to suppress the warning, as it would make me check for a newer option every time I looked at the code, but that's up to you :)

6

It is fine to use them. This just means Tridion reserves the right to remove these api's in the future. And they will never be removed if there are not replacements for all relevant functionalities.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.