OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 177 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 177 Rev 180
Line 41... Line 41...
41
import org.openconcerto.utils.i18n.Grammar_fr;
41
import org.openconcerto.utils.i18n.Grammar_fr;
42
import org.openconcerto.utils.i18n.NounClass;
42
import org.openconcerto.utils.i18n.NounClass;
43
 
43
 
44
import java.io.File;
44
import java.io.File;
45
import java.io.FileNotFoundException;
45
import java.io.FileNotFoundException;
46
import java.io.IOException;
-
 
47
import java.io.InputStream;
46
import java.io.InputStream;
48
import java.sql.SQLException;
47
import java.sql.SQLException;
49
import java.util.ArrayList;
48
import java.util.ArrayList;
50
import java.util.Arrays;
49
import java.util.Arrays;
51
import java.util.Collections;
50
import java.util.Collections;
Line 65... Line 64...
65
        if (confFilePath != null) {
64
        if (confFilePath != null) {
66
            confFile = new File(confFilePath);
65
            confFile = new File(confFilePath);
67
        } else if (wdFile.isFile()) {
66
        } else if (wdFile.isFile()) {
68
            confFile = wdFile;
67
            confFile = wdFile;
69
        } else {
68
        } else {
70
            // we added organisation name, so migrate preferences
-
 
71
            final File prefsFolder = BaseDirs.create(info).getPreferencesFolder();
69
            final File prefsFolder = BaseDirs.create(info).getPreferencesFolder();
72
            if (!prefsFolder.exists()) {
-
 
73
                try {
-
 
74
                    final File oldDir = DesktopEnvironment.getDE().getPreferencesFolder(info.getName());
-
 
75
                    Configuration.migrateToNewDir(oldDir, prefsFolder);
-
 
76
                } catch (IOException ex) {
-
 
77
                    throw new IllegalStateException("Couldn't migrate preferences dir", ex);
-
 
78
                }
-
 
79
            }
-
 
80
            confFile = new File(prefsFolder, "main.properties");
70
            confFile = new File(prefsFolder, "main.properties");
81
        }
71
        }
82
        return confFile;
72
        return confFile;
83
    }
73
    }
84
 
74