1 package fr.jayasoft.ivy.repository.vfs; 2 3 import java.io.File ; 4 import java.util.ArrayList ; 5 import java.util.List ; 6 7 import org.apache.commons.vfs.impl.StandardFileSystemManager; 8 9 import fr.jayasoft.ivy.Ivy; 10 import fr.jayasoft.ivy.util.FileUtil; 11 12 public class VfsTestHelper { 13 private Ivy ivy = null; 14 public StandardFileSystemManager fsManager = null; 15 final static public String VFS_CONF = "ivy_vfs.xml"; 16 17 static final public String PROP_VFS_HOST = "vfs.host"; 19 static final public String PROP_VFS_SAMBA_REPO = "vfs.samba.share"; 20 static final public String PROP_VFS_USER_ID = "vfs.user"; 21 static final public String PROP_VFS_USER_PASSWD = "vfs.passwd"; 22 23 static final public String CWD = System.getProperty("user.dir"); 25 static final public String TEST_REPO_DIR = "test/repositories"; 26 static final private String IVY_CONFIG_FILE = 27 FileUtil.concat(TEST_REPO_DIR, "ivyconf.xml"); 28 static final public String TEST_IVY_XML = "2/mod5.1/ivy-4.2.xml"; 29 static final public String SCRATCH_DIR = "_vfsScratchArea"; 30 31 32 public VfsTestHelper() throws Exception { 33 fsManager = new StandardFileSystemManager(); 35 fsManager.setConfiguration(getClass().getResource(VFS_CONF).toString()); 36 fsManager.init(); 37 38 ivy = new Ivy(); 40 ivy.configure(new File (IVY_CONFIG_FILE)); 41 } 42 43 49 public List createVFSUriSet(String resource) { 50 List set = new ArrayList (); 51 for (int i = 0; i < VfsURI.SUPPORTED_SCHEMES.length; i++) { 52 set.add(VfsURI.vfsURIFactory(VfsURI.SUPPORTED_SCHEMES[i], 53 resource, 54 ivy)); 55 } 56 return set; 57 } 58 59 60 public Ivy getIvy() { 61 return ivy; 62 } 63 64 65 } 66 | Popular Tags |