public static String getDocbookFileName(final RESTImageV1 source) {
        checkArgument(source != null, "The source parameter can not be null");

        if (source.getLanguageImages_OTM() != null && source.getLanguageImages_OTM().getItems() != null) {
            final List<RESTLanguageImageV1> langImages = source.getLanguageImages_OTM().returnItems();
            for (final RESTLanguageImageV1 langImage : langImages) {
                final String filename = langImage.getFilename();
                if (filename != null) {
                    final int indexOfExtension = filename.lastIndexOf('.');

                    if (indexOfExtension != -1 && indexOfExtension < filename.length() - 1) {
                        final String extension = filename.substring(indexOfExtension, filename.length());
                        return source.getId() + extension;
                    }
                }
            }
        }

        return "";
    }
public static String getDocbookFileName ( final RESTImageV1 source ) { checkArgument ( source != null , "The source parameter can not be null" ) ; if ( source . getLanguageImages_OTM ( ) != null && source . getLanguageImages_OTM ( ) . getItems ( ) != null ) { final List < RESTLanguageImageV1 > langImages = source . getLanguageImages_OTM ( ) . returnItems ( ) ; for ( final RESTLanguageImageV1 langImage : langImages ) { final String filename = langImage . getFilename ( ) ; if ( filename != null ) { final int indexOfExtension = filename . lastIndexOf ( '.' ) ; if ( indexOfExtension != - 1 && indexOfExtension < filename . length ( ) - 1 ) { final String extension = filename . substring ( indexOfExtension , filename . length ( ) ) ; return source . getId ( ) + extension ; } } } } return "" ; }
The docbook file name for an image is the ID of the image and the
extension of the first language image. This does imply that you can not
mix and match image formats within a single image.

@param source The RESTImageV1 object to get the docbook filename for
@return The docbook file name