wneuper@3922
|
1 |
/*
|
wneuper@3922
|
2 |
* @author Walther Neuper, member of the ISAC-team,
|
wneuper@3922
|
3 |
* Copyright (c) 2005 by Walther Neuper
|
wneuper@3922
|
4 |
* created Mar 12, 2005 8:55:37 AM
|
wneuper@3922
|
5 |
* Institute for Softwaretechnology, Graz University of Technology, Austria.
|
wneuper@3922
|
6 |
*
|
wneuper@3922
|
7 |
* Use is subject to PGPL license terms.
|
wneuper@3922
|
8 |
*/
|
wneuper@3922
|
9 |
package isac.util.users;
|
wneuper@3922
|
10 |
|
wneuper@3922
|
11 |
import java.io.FileOutputStream;
|
wneuper@3922
|
12 |
import java.io.IOException;
|
wneuper@3922
|
13 |
import java.util.Properties;
|
wneuper@3922
|
14 |
|
wneuper@3922
|
15 |
/**
|
wneuper@3922
|
16 |
* @author Walther Neuper
|
wneuper@3922
|
17 |
*
|
wneuper@3922
|
18 |
* contains administrative data (and nothing about the dialog !!!) looking
|
wneuper@3922
|
19 |
* forward to be handled elsewhere outside isac
|
wneuper@3922
|
20 |
*/
|
wneuper@3922
|
21 |
public class UserAdmin extends Properties {
|
wneuper@3922
|
22 |
|
wneuper@3922
|
23 |
private String userpath_;
|
wneuper@3922
|
24 |
|
wneuper@3922
|
25 |
private String username_;
|
wneuper@3922
|
26 |
|
wneuper@3922
|
27 |
public UserAdmin(String userpath, String username) {
|
wneuper@3922
|
28 |
userpath_ = userpath;
|
wneuper@3922
|
29 |
username_ = username;
|
wneuper@3922
|
30 |
//TODO.WN050311
|
wneuper@3922
|
31 |
}
|
wneuper@3922
|
32 |
|
wneuper@3922
|
33 |
//WN050311 just for creation of the first file
|
wneuper@3922
|
34 |
//beware of the fix path !
|
wneuper@3922
|
35 |
public static void main(String[] args) {
|
wneuper@3922
|
36 |
UserAdmin a = new UserAdmin("isac/xmldata/users", "x");
|
wneuper@3922
|
37 |
a.setProperty("firstName", "x-firstName");
|
wneuper@3922
|
38 |
a.setProperty("lastName", "x-lastName");
|
wneuper@3922
|
39 |
|
wneuper@3922
|
40 |
String filename = "isac/xmldata/users/x_admin.txt";
|
wneuper@3922
|
41 |
try {
|
wneuper@3922
|
42 |
FileOutputStream propOutFile = new FileOutputStream(filename);
|
wneuper@3922
|
43 |
a.store(propOutFile, "administrative data of user 'x'");
|
wneuper@3922
|
44 |
|
wneuper@3922
|
45 |
} catch (IOException e) {
|
wneuper@3922
|
46 |
System.err.println("I/O failed.");
|
wneuper@3922
|
47 |
}
|
wneuper@3922
|
48 |
|
wneuper@3922
|
49 |
}
|
wneuper@3922
|
50 |
|
wneuper@3922
|
51 |
} |