1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.vfs2.provider.zip;
19
20 import java.nio.charset.Charset;
21
22 import org.apache.commons.vfs2.FileSystem;
23 import org.apache.commons.vfs2.FileSystemConfigBuilder;
24 import org.apache.commons.vfs2.FileSystemOptions;
25
26 public class ZipFileSystemConfigBuilder extends FileSystemConfigBuilder {
27
28 private static final String _PREFIX = ZipFileSystemConfigBuilder.class.getName();
29 private static final ZipFileSystemConfigBuilderSystemConfigBuilder.html#ZipFileSystemConfigBuilder">ZipFileSystemConfigBuilder INSTANCE = new ZipFileSystemConfigBuilder();
30 private static final String KEY_CHARSET = _PREFIX + ".charset";
31
32 public static final ZipFileSystemConfigBuilder getInstance() {
33 return INSTANCE;
34 }
35
36 private ZipFileSystemConfigBuilder() {
37 super("zip.");
38 }
39
40 public Charset getCharset(final FileSystemOptions opts) {
41 return getParam(opts, KEY_CHARSET);
42 }
43
44 @Override
45 protected Class<? extends FileSystem> getConfigClass() {
46 return ZipFileSystem.class;
47 }
48
49 public void setCharset(final FileSystemOptions opts, final Charset charset) {
50 setParam(opts, KEY_CHARSET, charset);
51 }
52
53 }