Revision 806329e3
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/external/RubikNetwork.java | ||
---|---|---|
753 | 753 |
HttpURLConnection conn = (HttpURLConnection) connectURL.openConnection(); |
754 | 754 |
conn.setDoInput(true); |
755 | 755 |
conn.connect(); |
756 |
InputStream stream = conn.getInputStream(); |
|
757 |
conn.disconnect(); |
|
758 |
return stream; |
|
756 |
return conn.getInputStream(); |
|
759 | 757 |
} |
760 | 758 |
catch (IOException e) |
761 | 759 |
{ |
... | ... | |
773 | 771 |
if(info.mUpdateExtras) info.mExtrasStream = downloadJSON(info.mObjectShortName+"_extras.json"); |
774 | 772 |
|
775 | 773 |
downloadee.jsonDownloaded(); |
774 |
|
|
775 |
try |
|
776 |
{ |
|
777 |
if( info.mObjectStream!=null ) info.mObjectStream.close(); |
|
778 |
} |
|
779 |
catch(IOException ioe) |
|
780 |
{ |
|
781 |
android.util.Log.e("D", "failed to close object input stream"); |
|
782 |
} |
|
783 |
|
|
784 |
try |
|
785 |
{ |
|
786 |
if( info.mExtrasStream!=null ) info.mExtrasStream.close(); |
|
787 |
} |
|
788 |
catch(IOException ioe) |
|
789 |
{ |
|
790 |
android.util.Log.e("D", "failed to close extras input stream"); |
|
791 |
} |
|
776 | 792 |
} |
777 | 793 |
|
778 | 794 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Support for saving the downloaded JSONs in local data storage.