01: /*
02: * LobFileParameter.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.util;
13:
14: import java.io.Closeable;
15: import workbench.util.FileUtil;
16:
17: /**
18: * @author support@sql-workbench.net
19: */
20: public class LobFileParameter {
21: private Closeable dataStream;
22: private String filename;
23: private String encoding;
24: private boolean binary;
25:
26: public LobFileParameter() {
27: }
28:
29: public LobFileParameter(String fname, String enc, boolean isBinary) {
30: setFilename(fname);
31: setEncoding(enc);
32: setBinary(isBinary);
33: }
34:
35: public String toString() {
36: return "filename=[" + filename + "], binary=" + binary
37: + ", encoding=" + encoding;
38: }
39:
40: public void setDataStream(Closeable in) {
41: this .dataStream = in;
42: }
43:
44: public void close() {
45: FileUtil.closeQuitely(dataStream);
46: }
47:
48: public void setBinary(boolean flag) {
49: binary = flag;
50: }
51:
52: public boolean isBinary() {
53: return binary;
54: }
55:
56: public String getFilename() {
57: return filename;
58: }
59:
60: public void setFilename(String fname) {
61: filename = fname;
62: }
63:
64: public String getEncoding() {
65: return encoding;
66: }
67:
68: public void setEncoding(String enc) {
69: encoding = enc;
70: }
71: }
|