project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadPackage.java
branchhedgeroid
changeset 7857 2bc61f8841a1
parent 7586 33924ff4af50
child 10017 de822cd3df3a
equal deleted inserted replaced
7855:ddcdedd3330b 7857:2bc61f8841a1
     1 /*
     1 /*
     2  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
     2  * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
     3  * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@xelification.com>
     3  * Copyright (c) 2011-2012 Richard Deurwaarder <xeli@xelification.com>
     4  *
     4  *
     5  * This program is free software; you can redistribute it and/or modify
     5  * This program is free software; you can redistribute it and/or
     6  * it under the terms of the GNU General Public License as published by
     6  * modify it under the terms of the GNU General Public License
     7  * the Free Software Foundation; version 2 of the License
     7  * as published by the Free Software Foundation; either version 2
       
     8  * of the License, or (at your option) any later version.
     8  *
     9  *
     9  * This program is distributed in the hope that it will be useful,
    10  * This program is distributed in the hope that it will be useful,
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  * GNU General Public License for more details.
    13  * GNU General Public License for more details.
    13  *
    14  *
    14  * You should have received a copy of the GNU General Public License
    15  * You should have received a copy of the GNU General Public License
    15  * along with this program; if not, write to the Free Software
    16  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    17  */
    18  */
    18 
    19 
    19 package org.hedgewars.hedgeroid.Downloader;
    20 package org.hedgewars.hedgeroid.Downloader;
    20 
    21 
    21 import java.io.IOException;
    22 import java.io.IOException;
    22 
    23 
    23 import org.hedgewars.hedgeroid.Utils;
    24 import org.hedgewars.hedgeroid.util.FileUtils;
    24 import org.xmlpull.v1.XmlPullParser;
    25 import org.xmlpull.v1.XmlPullParser;
    25 import org.xmlpull.v1.XmlPullParserException;
    26 import org.xmlpull.v1.XmlPullParserException;
    26 
    27 
    27 import android.content.Context;
    28 import android.content.Context;
    28 import android.content.SharedPreferences;
    29 import android.content.SharedPreferences;
    29 import android.os.Parcel;
    30 import android.os.Parcel;
    30 import android.os.Parcelable;
    31 import android.os.Parcelable;
    31 import android.preference.PreferenceManager;
    32 import android.preference.PreferenceManager;
    32 import android.util.Log;
       
    33 
    33 
    34 public class DownloadPackage implements Parcelable{
    34 public class DownloadPackage implements Parcelable{
    35 	private String url_without_suffix;
    35 	private String url_without_suffix;
    36 	private String pathToStore;
    36 	private String pathToStore;
    37 	private String representation;
    37 	private String representation;
   135 						}catch (NumberFormatException e){
   135 						}catch (NumberFormatException e){
   136 							e.printStackTrace();
   136 							e.printStackTrace();
   137 							version = -1;
   137 							version = -1;
   138 						}
   138 						}
   139 					}else if(name.equals("path")){
   139 					}else if(name.equals("path")){
   140 						path = Utils.getDataPath(c) + text;
   140 						path = FileUtils.getDataPathFile(c, text).getAbsolutePath();
   141 					}else if(name.equals("representation")){
   141 					}else if(name.equals("representation")){
   142 						representation = text;
   142 						representation = text;
   143 					}else if(name.equals("description")){
   143 					}else if(name.equals("description")){
   144 						description = text;
   144 						description = text;
   145 					}else if(name.equals("uniqueid")){
   145 					}else if(name.equals("uniqueid")){