buffering = new Hashtable<String, SyncFilesBufferingProvider>();
buffering.put("syncfiles", new SyncFilesBufferingProvider());
}
public final Site createConnection(final ConnectionDescription desc) throws FileSystemException, IOException, URISyntaxException {
FileSystem fs = null;
URI url = desc.getUri();
String scheme = url.getScheme();
if (scheme != null) {
fs = schemes.get(scheme);
}
if (fs == null) {
// TODO maybe we should test and correct this in profile dialog !?
// no fs found, test for native path
File f = new File(url.toString()); // ignore query as local won't need query
if (f.exists()) {
fs = schemes.get("file");
url = f.toURI();
desc.setUri(url);
}
else {
throw new URISyntaxException(url.toString(), "Not a valid uri or unknown scheme");
}
}
Site s = fs.createConnection(desc);
String bufferStrategy = desc.getParameter("bufferStrategy");
if ((null != bufferStrategy) && !"".equals(bufferStrategy)) {
s = resolveBuffering(s, bufferStrategy);