01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html.
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12: package org.tmatesoft.svn.core.internal.io.dav.http;
13:
14: import java.io.File;
15:
16: import org.tmatesoft.svn.core.SVNException;
17: import org.tmatesoft.svn.core.io.SVNRepository;
18:
19: /**
20: * @version 1.1.2
21: * @author TMate Software Ltd.
22: */
23: public class DefaultHTTPConnectionFactory implements
24: IHTTPConnectionFactory {
25:
26: private File mySpoolDirectory;
27: private String myHTTPCharset;
28: private boolean myIsSpoolAll;
29:
30: public DefaultHTTPConnectionFactory(File spoolDirectory,
31: boolean spoolAll, String httpCharset) {
32: mySpoolDirectory = spoolDirectory;
33: myIsSpoolAll = spoolAll;
34: myHTTPCharset = httpCharset;
35: }
36:
37: public IHTTPConnection createHTTPConnection(SVNRepository repository)
38: throws SVNException {
39: String charset = myHTTPCharset != null ? myHTTPCharset : System
40: .getProperty("svnkit.http.encoding", "US-ASCII");
41: File spoolLocation = mySpoolDirectory;
42: if (mySpoolDirectory != null && !mySpoolDirectory.isDirectory()) {
43: spoolLocation = null;
44: }
45: return new HTTPConnection(repository, charset, spoolLocation,
46: myIsSpoolAll);
47: }
48:
49: }
|