Clover Coverage Report - Impex Parent 1.0.21-SNAPSHOT (Aggregated)
Coverage timestamp: Tue Feb 8 2011 11:33:53 EST
../img/srcFileCovDistChart0.png 0% of files have more coverage
33   77   9   4.71
2   57   0.27   7
7     1.29  
1    
 
  Deploy       Line # 7 33 0% 9 42 0% 0.0
 
No Tests
 
1    import java.io.IOException;
2    import java.text.ParseException;
3    import java.text.SimpleDateFormat;
4   
5    import org.apache.commons.lang.StringUtils;
6   
 
7    public class Deploy {
8    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd.hhmmss");
9   
 
10  0 toggle public static void main(final String[] args) {
11  0 Deploy deploy = new Deploy();
12  0 deploy.run();
13    }
14   
 
15  0 toggle public void run() {
16  0 try {
17  0 String url = getCurlUrl();
18  0 System.out.println("\n" + url);
19    } catch (Throwable t) {
20  0 t.printStackTrace();
21    }
22    }
23   
 
24  0 toggle protected String getCurlUrl() throws Exception {
25  0 return null;
26    //String url = getUrl("maven-metadata.xml");
27    //String xml = getContents(url);
28    //BuildInfo bi = getBuildInfo(xml);
29    //String filename = getFilename(bi);
30    //return getUrl(filename);
31    }
32   
 
33  0 toggle protected String getFilename(final BuildInfo bi) {
34  0 StringBuffer sb = new StringBuffer();
35  0 sb.append(bi.getArtifactId());
36  0 sb.append("-");
37  0 String version = bi.getVersion();
38  0 if (version.endsWith("-SNAPSHOT")) {
39  0 version = StringUtils.replace(version, "-SNAPSHOT", "");
40    }
41  0 sb.append(version);
42  0 sb.append("-");
43  0 sb.append(sdf.format(bi.getTimestamp()));
44  0 sb.append("-");
45  0 sb.append(bi.getBuildNumber());
46  0 sb.append(".war");
47  0 return sb.toString();
48    }
49   
 
50  0 toggle protected BuildInfo getBuildInfo(final String contents) throws ParseException {
51  0 String artifactId = StringUtils.substringBetween(contents, "<artifactId>", "</artifactId>");
52  0 String version = StringUtils.substringBetween(contents, "<version>", "</version>");
53  0 String buildNumber = StringUtils.substringBetween(contents, "<buildNumber>", "</buildNumber>");
54  0 String timestamp = StringUtils.substringBetween(contents, "<timestamp>", "</timestamp>");
55   
56  0 BuildInfo bi = new BuildInfo();
57  0 bi.setArtifactId(artifactId);
58  0 bi.setVersion(version);
59  0 bi.setBuildNumber(new Integer(buildNumber));
60  0 bi.setTimestamp(sdf.parse(timestamp));
61  0 return bi;
62    }
63   
 
64  0 toggle protected String getUrl(final String filename) {
65  0 String base = "http://maven.kuali.org/snapshot/org/kuali/student/web/ks-embedded/1.1.0-M9-SNAPSHOT/";
66  0 return base + filename;
67    }
68   
 
69  0 toggle protected String getContents(final String url) throws IOException { // HttpException {
70  0 return null;
71    //HttpClient client = new HttpClient();
72    //HttpMethod method = new GetMethod(url);
73    //client.executeMethod(method);
74    //return method.getResponseBodyAsString();
75    }
76   
77    }