public File getFile ( ) throws APIException , IOException { String filename = getName ( ) ; int extensionIndex = filename . lastIndexOf ( ' ' ) ; String body ; String ext ; if ( extensionIndex <= 0 ) { // No extension body = filename ; ext = "" ; } else { body = filename . substring ( 0 , extensionIndex ) ; ext = filename . substring ( extensionIndex ) ; } if ( body . length ( ) < 3 || body . length ( ) > 127 ) { // prefix must be at least 3 characters body = "algodata" ; } File tempFile = File . createTempFile ( body , ext ) ; client . getFile ( getUrl ( ) , tempFile ) ; return tempFile ; }
Gets the data for this file and saves it to a local temporary file