HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-07-26 dec7a70e42bd164ee5403fb3c563e87fa803d14b
NullPointers in property handling
2 files modified
14 ■■■■ changed files
hsarjcli/src/de/hsadmin/jscli/CASTicket.java 8 ●●●● patch | view | raw | blame | history
hsarjcli/src/de/hsadmin/jscli/Config.java 6 ●●●● patch | view | raw | blame | history
hsarjcli/src/de/hsadmin/jscli/CASTicket.java
@@ -117,6 +117,7 @@
    }
    private String readFiledGrantingTicket() throws JSCliException {
        String filedTicket = null;
        String userHome = System.getProperty("user.home");
        String ticketFileName = userHome + "/.hsadmin.tgt";
        File file = new File(ticketFileName);
@@ -124,12 +125,15 @@
            Properties properties = new Properties();
            try {
                properties.load(new FileReader(file));
                return properties.getProperty(user);
                filedTicket = properties.getProperty(user);
            } catch (IOException e) {
                throw new JSCliException(e);
            }
        }
        return null;
        if (filedTicket == null) {
            filedTicket = getGrantingTicket();
        }
        return filedTicket;
    }
    private void writeFiledGrantingTicket(String ticket) throws JSCliException {
hsarjcli/src/de/hsadmin/jscli/Config.java
@@ -43,7 +43,11 @@
    }
    
    public String getProperty(String propertyName) {
        return props.getProperty(propertyName).trim();
        String property = props.getProperty(propertyName);
        if (property == null) {
            return null;
        }
        return property.trim();
    }
    
    public String getProperty(String propertyName, String defaultValue) {