X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fvamsas%2Fclient%2FSimpleClientFactory.java;h=5b9346f9daf4502750b992465463b93013aad93c;hb=2e92d5449226c6b2423129d779977df26fe74ec6;hp=5a53bd261df16c1247262fa04632bfdc6494a77e;hpb=c062fe4c183d567877484f0229631dc555ddc9f5;p=vamsas.git diff --git a/src/org/vamsas/client/SimpleClientFactory.java b/src/org/vamsas/client/SimpleClientFactory.java index 5a53bd2..5b9346f 100644 --- a/src/org/vamsas/client/SimpleClientFactory.java +++ b/src/org/vamsas/client/SimpleClientFactory.java @@ -1,28 +1,38 @@ package org.vamsas.client; + +import java.io.File; +import java.io.IOException; + /** * TODO document type SimpleClientFactory * @author jimp * */ public class SimpleClientFactory implements IClientFactory { - static SimpleClientFactory singleton = null; - - static private void CreateClientFactory() { - if (singleton != null) { - - } else { - // Create singleton class. - - } + + File sessionArena; + + /** + * default constructor - called by CreateClientFactory only. + * + */ + public SimpleClientFactory() { + sessionArena = null; } /** * Create a client factory that works with sessions at the given * path. * @param path */ - public SimpleClientFactory(String path) { + public SimpleClientFactory(String path) throws IOException { // Check path is valid and read/writeable. - // make housekeeping files... + File newarena = new File(path); + if (newarena.isDirectory() && newarena.canRead() && newarena.canWrite()) { + sessionArena = newarena; + } else { + sessionArena = null; + throw(new IOException("Cannot read and write to a directory called "+path)); + } } /* (non-Javadoc) * @see org.vamsas.client.IClientFactory#getIClient(org.vamsas.client.ClientHandle)