public User getUploadStatus ( ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_UPLOAD_STATUS ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element userElement = response . getPayload ( ) ; User user = new User ( ) ; user . setId ( userElement . getAttribute ( "id" ) ) ; user . setPro ( "1" . equals ( userElement . getAttribute ( "ispro" ) ) ) ; user . setUsername ( XMLUtilities . getChildValue ( userElement , "username" ) ) ; Element bandwidthElement = XMLUtilities . getChild ( userElement , "bandwidth" ) ; user . setBandwidthMax ( bandwidthElement . getAttribute ( "max" ) ) ; user . setBandwidthUsed ( bandwidthElement . getAttribute ( "used" ) ) ; user . setIsBandwidthUnlimited ( "1" . equals ( bandwidthElement . getAttribute ( "unlimited" ) ) ) ; Element filesizeElement = XMLUtilities . getChild ( userElement , "filesize" ) ; user . setFilesizeMax ( filesizeElement . getAttribute ( "max" ) ) ; Element setsElement = XMLUtilities . getChild ( userElement , "sets" ) ; user . setSetsCreated ( setsElement . getAttribute ( "created" ) ) ; user . setSetsRemaining ( setsElement . getAttribute ( "remaining" ) ) ; Element videosElement = XMLUtilities . getChild ( userElement , "videos" ) ; user . setVideosUploaded ( videosElement . getAttribute ( "uploaded" ) ) ; user . setVideosRemaining ( videosElement . getAttribute ( "remaining" ) ) ; Element videoSizeElement = XMLUtilities . getChild ( userElement , "videosize" ) ; user . setVideoSizeMax ( videoSizeElement . getAttribute ( "maxbytes" ) ) ; return user ; }
Get upload status for the currently authenticated user .