Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.googlecode.mad.mvntools.settingsutil.filestore;
  
  
Abstract Mojo to backup and restore a .x files from a project
 
 public abstract class AbstractFilestore extends AbstractMojo {
 	
 	protected final static String	FOLDER"XXfolder:";
 	protected final static String	FILE"XXfile:";
 	
 	protected String				name"abstractFilestore";
 	
 	protected XStream				xstreamnew XStream(new DomDriver());

The project dependencies. *

Parameter:
expression="${project.build.directory} "
 
 	protected String				buildDir;
 	
 	protected String[]				files	= { ".project"".classpath" };
 	
 	protected String[]				folders	= { ".settings" };

The configured files

Parameter:
alias="files"
 
 	private String[]				providedFiles;

The configured folders

Parameter:
alias="folders"
 
 	private String[]				providedFolders;

The name of the backup-file

Parameter:
alias="backupfile" default-value="settingsutil.xml"
 
 	protected String				backupFile;

The User

Parameter:
alias="user" default-value="default"
 
 	protected String				user;
 	
 	public void execute() throws MojoExecutionException {
 		
 		String first = "************************************************************************";
 		
 		StringBuilder b = new StringBuilder();
 		b.append("*** ");
 		b.append();
 		b.append(": ");
 		b.append(MavenVersionUtil.getInstance().getVersionString());
 		b.append(", built on ");
 		b.append(MavenVersionUtil.getInstance().getDateString());
 		
 		while ((b.length() + 4) < first.length()) {
 			b.append(" ");
 		}
 		b.append(" ***");
 		
 		getLog().info(first);
 		getLog().info(first);
 		getLog().info("");
 		
 		// overwrite the default files and folders if there are cnfigured ones
 		if ( != null && . > 0) {
 			this. = ;
 		}
 		
 		if ( != null && . > 0) {
 		}
 		
 		
 	}
 	
 	protected abstract void myExecute();
 	
 	protected String getRootPath() {
 		return this..replace("target""");
	}
New to GrepCode? Check out our FAQ X