OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 80 Rev 174
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.ui.state;
14
 package org.openconcerto.ui.state;
15
 
15
 
-
 
16
import org.openconcerto.utils.FileUtils;
-
 
17
 
16
import java.io.File;
18
import java.io.File;
17
import java.io.IOException;
19
import java.io.IOException;
18
import java.security.AccessController;
20
import java.security.AccessController;
19
import java.security.PrivilegedAction;
21
import java.security.PrivilegedAction;
20
import java.security.PrivilegedActionException;
22
import java.security.PrivilegedActionException;
Line 81... Line 83...
81
        }
83
        }
82
        try {
84
        try {
83
            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
85
            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
84
                @Override
86
                @Override
85
                public Object run() throws IOException {
87
                public Object run() throws IOException {
86
                    if (file.getParentFile() != null && !file.getParentFile().exists()) {
-
 
87
                        file.getParentFile().mkdirs();
88
                    FileUtils.mkParentDirs(file);
88
                    }
-
 
89
 
-
 
90
                    writeState(file);
89
                    writeState(file);
91
                    return null;
90
                    return null;
92
                }
91
                }
93
            });
92
            });
94
        } catch (PrivilegedActionException e) {
93
        } catch (PrivilegedActionException e) {