Class MediaFileUtils.MediaUploadResponse

  • Enclosing class:
    MediaFileUtils

    public static class MediaFileUtils.MediaUploadResponse
    extends Object
    • Field Detail

      • result

        public String result
      • filename

        public String filename
      • pageid

        public long pageid
      • warnings

        public Map<String,​com.fasterxml.jackson.databind.JsonNode> warnings
    • Constructor Detail

      • MediaUploadResponse

        public MediaUploadResponse()
    • Method Detail

      • checkForErrors

        public void checkForErrors()
                            throws org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException
        Checks that the upload was successful, and if not raise an exception
        Throws:
        org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException
      • getMid

        public org.wikidata.wdtk.datamodel.interfaces.MediaInfoIdValue getMid​(org.wikidata.wdtk.wikibaseapi.ApiConnection connection,
                                                                              String siteIri)
                                                                       throws IOException,
                                                                              org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException
        Retrieves the Mid, either from the upload response or by issuing another call to obtain it from the filename through the supplied connection. This should not be needed anymore when this is already exposed in the API response of the upload action. https://phabricator.wikimedia.org/T307096
        Parameters:
        connection -
        Returns:
        Throws:
        org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException
        IOException