1 7 package com.inversoft.savant; 8 9 10 import java.io.File ; 11 import java.net.MalformedURLException ; 12 import java.net.URL ; 13 14 15 28 public class MavenURLBuilder extends AbstractURLBuilder { 29 30 41 public URL buildURL(String defaultDomain, File mapping, Artifact artifact) 42 throws SavantException { 43 String baseURL = makeBaseURLSpec(defaultDomain, mapping, artifact); 44 URL url = null; 45 if (baseURL != null) { 46 String urlSpec = baseURL + "/" + makeURLSpec(artifact); 47 try { 48 url = new URL (urlSpec); 49 } catch (MalformedURLException mue) { 50 throw new SavantException(mue); 51 } 52 } 53 54 return url; 55 } 56 57 68 public URL buildMD5URL(String defaultDomain, File mapping, Artifact artifact) 69 throws SavantException { 70 String baseURL = makeBaseURLSpec(defaultDomain, mapping, artifact); 71 URL url = null; 72 if (baseURL != null) { 73 String urlSpec = baseURL + "/" + makeURLSpec(artifact) + ".md5"; 74 try { 75 url = new URL (urlSpec); 76 } catch (MalformedURLException mue) { 77 throw new SavantException(mue); 78 } 79 } 80 81 return url; 82 } 83 84 94 public URL buildDepsURL(String defaultDomain, File mapping, 95 Artifact artifact) 96 throws SavantException { 97 return null; 98 } 99 100 106 private String makeURLSpec(Artifact artifact) { 107 return artifact.getProjectname() + "/jars/" + artifact.getName() + "-" + 108 artifact.getVersion() + ".jar"; 109 } 110 } 111
| Popular Tags
|