src/java/isac/util/users/UserAdmin.java
branchjava_rename_format
changeset 3922 fcd5648113ca
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/java/isac/util/users/UserAdmin.java	Wed Jun 15 18:31:02 2005 +0200
     1.3 @@ -0,0 +1,51 @@
     1.4 +/*
     1.5 + * @author Walther Neuper, member of the ISAC-team, 
     1.6 + * Copyright (c) 2005 by Walther Neuper 
     1.7 + * created Mar 12, 2005 8:55:37 AM
     1.8 + * Institute for Softwaretechnology, Graz University of Technology, Austria.
     1.9 + * 
    1.10 + * Use is subject to PGPL license terms.
    1.11 + */
    1.12 +package isac.util.users;
    1.13 +
    1.14 +import java.io.FileOutputStream;
    1.15 +import java.io.IOException;
    1.16 +import java.util.Properties;
    1.17 +
    1.18 +/**
    1.19 + * @author Walther Neuper
    1.20 + * 
    1.21 + * contains administrative data (and nothing about the dialog !!!) looking
    1.22 + * forward to be handled elsewhere outside isac
    1.23 + */
    1.24 +public class UserAdmin extends Properties {
    1.25 +
    1.26 +    private String userpath_;
    1.27 +
    1.28 +    private String username_;
    1.29 +
    1.30 +    public UserAdmin(String userpath, String username) {
    1.31 +        userpath_ = userpath;
    1.32 +        username_ = username;
    1.33 +        //TODO.WN050311
    1.34 +    }
    1.35 +
    1.36 +    //WN050311 just for creation of the first file
    1.37 +    //beware of the fix path !
    1.38 +    public static void main(String[] args) {
    1.39 +        UserAdmin a = new UserAdmin("isac/xmldata/users", "x");
    1.40 +        a.setProperty("firstName", "x-firstName");
    1.41 +        a.setProperty("lastName", "x-lastName");
    1.42 +
    1.43 +        String filename = "isac/xmldata/users/x_admin.txt";
    1.44 +        try {
    1.45 +            FileOutputStream propOutFile = new FileOutputStream(filename);
    1.46 +            a.store(propOutFile, "administrative data of user 'x'");
    1.47 +
    1.48 +        } catch (IOException e) {
    1.49 +            System.err.println("I/O failed.");
    1.50 +        }
    1.51 +
    1.52 +    }
    1.53 +
    1.54 +}
    1.55 \ No newline at end of file