Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.googlecode.mad.mvntools.settingsutil.filestore;
 
- Apache License 2.0 -
Mojo to back up the Files in a x.xml-file: rename a user

LastChangedBy: $Author: marthaler.worb@gmail.com $
LastChangedDate: $Date: 2010-12-29 14:14:06 +0100 (Wed, 29 Dec 2010) $

Author(s):
daniel marthaler
Version:
$Revision: 21 $
Since:
19.01.2011
Goal:
deletename
public class ListnamesFilestore extends AbstractFilestore {
    
    public ListnamesFilestore() {
        super();
        this. = "SettingsUtil:rename";
    }
    
    @Override
    @SuppressWarnings("unchecked")
    protected void myExecute() {
        
        TreeMap<StringTreeMap<StringString>> myMap = null;
        
        String temp = null;
        
        temp = this..loadFile(this.getRootPath() + this.);
        
        if ((temp != null) && (temp.length() > 0)) {
            try {
                myMap = (TreeMap<StringTreeMap<StringString>>) this..fromXML(temp);
            } catch (final Exception e) {
                this.getLog().debug("unmarshaling not possible");
            }
        }
        
        if (!myMap.containsKey(this.)) {
            this.getLog().error("name: " + this. + " not found, coluld not delete");
            return;
        }
        
        final TreeMap<StringStringfiles = myMap.remove(this.);
        
        this..replaceFileWithNewContent(this.getRootPath() + this.this..toXML(myMap));
    }
New to GrepCode? Check out our FAQ X